]> granicus.if.org Git - php/commitdiff
Deprecate mb_parse_str() without second argument
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 1 Feb 2017 23:44:18 +0000 (00:44 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 3 Feb 2017 17:52:57 +0000 (18:52 +0100)
Zend/tests/this_in_mb_parse_str.phpt
ext/mbstring/mbstring.c
ext/mbstring/tests/bug20087.phpt
ext/mbstring/tests/common.inc
ext/mbstring/tests/mb_parse_str.phpt
ext/mbstring/tests/mb_parse_str02.phpt

index 8dfac94722e0e24aa8ddb08d65653ab712c601f4..2d5af4794e1dadbdf60d63cb336634718232bc02 100644 (file)
@@ -11,6 +11,8 @@ function foo() {
 foo();
 ?>
 --EXPECTF--
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
+
 Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_mb_parse_str.php:3
 Stack trace:
 #0 %sthis_in_mb_parse_str.php(3): mb_parse_str('this=42')
index 6894d8eac7c1d710939c793e61df08ed7e6f38f2..80393d8b35d3ec07cf635811b63d70c027763ce5 100644 (file)
@@ -2195,6 +2195,8 @@ PHP_FUNCTION(mb_parse_str)
                        return;
                }
 
+               php_error_docref(NULL, E_DEPRECATED, "Calling mb_parse_str() without the result argument is deprecated");
+
                symbol_table = zend_rebuild_symbol_table();
                ZVAL_ARR(&tmp, symbol_table);
                detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr);
index 01bcc90388ea0241445f1899ffa6323defe9976d..ea6ce1a37d7e759bcbd1ee20807b92a49c60db2e 100644 (file)
@@ -15,8 +15,10 @@ var_dump(mb_parse_str("test=moo"));
 var_dump($test);
 ?>
 --EXPECT--
+ERR: Deprecated
 bool(true)
 string(0) ""
+ERR: Deprecated
 bool(true)
 string(3) "moo"
 
index 4205cce7bc1f66acc11ecedb07903b5c9363073f..c686b0696c0830fc24693d6fe99efbcfa808c20f 100644 (file)
@@ -21,6 +21,7 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
                                1024=> "User Notice",           // E_USER_NOTICE
                                2048=> "Strict Notice",      // E_STRICT
                                4096=> "Recoverable fatal error",      // E_RECOVERABLE_ERROR
+                               8192=> "Deprecated",      // E_DEPRECATED
                                );
        
        if (!empty($debug)) {
index 59d187bd05fc2f1432d64d1e979791ed96956c20..94f6a9f0a027643936294ff71cc13e83fffdd16b 100644 (file)
@@ -28,7 +28,7 @@ foreach ($queries as $query) {
        test($query);
 }
 ?>
---EXPECT--
+--EXPECTF--
 array(2) {
   ["foo"]=>
   string(3) "abc"
@@ -37,6 +37,8 @@ array(2) {
 }
 string(0) ""
 string(0) ""
+
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
 string(3) "abc"
 string(3) "def"
 array(2) {
@@ -47,6 +49,8 @@ array(2) {
 }
 string(0) ""
 string(0) ""
+
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
 string(0) ""
 string(0) ""
 array(2) {
@@ -67,6 +71,8 @@ array(2) {
 }
 string(0) ""
 string(0) ""
+
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
 array(3) {
   [0]=>
   string(3) "abc"
index f35699928e0f94745b584b74effb162942584a53..d89137de07bb8bf862707eec56ef2ffe4db8e4df 100644 (file)
@@ -31,7 +31,7 @@ foreach ($queries as $query) {
        test($query);
 }
 ?>
---EXPECT--
+--EXPECTF--
 array(3) {
   ["foo"]=>
   string(3) "abc"
@@ -43,6 +43,8 @@ array(3) {
 string(0) ""
 string(0) ""
 string(0) ""
+
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
 string(3) "abc"
 string(3) "def"
 string(3) "ghi"
@@ -57,6 +59,8 @@ array(3) {
 string(0) ""
 string(0) ""
 string(0) ""
+
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
 string(0) ""
 string(0) ""
 string(0) ""
@@ -86,6 +90,8 @@ array(3) {
 string(0) ""
 string(0) ""
 string(0) ""
+
+Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d
 array(4) {
   [0]=>
   string(3) "abc"