]> granicus.if.org Git - php/commitdiff
Deprecate track_errors / $php_errormsg
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 2 Feb 2017 20:15:36 +0000 (21:15 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 3 Feb 2017 20:02:52 +0000 (21:02 +0100)
12 files changed:
Zend/tests/bug54585.phpt
Zend/tests/bug67858.phpt
Zend/tests/php_errormsg_misoptimization.phpt
ext/hash/tests/hash_pbkdf2_error.phpt
ext/shmop/tests/001.phpt
ext/standard/tests/strings/implode.phpt
main/main.c
php.ini-development
run-tests.php
tests/run-test/test005.phpt
tests/run-test/test008.phpt
tests/run-test/test008a.phpt

index 2ca11f3e6a6d7c11da5abc94c0e3fd36d7710df6..deabe55af84f1bbd20ec75e172fed5367d94a4db 100644 (file)
@@ -5,11 +5,13 @@ track_errors=On
 --FILE--
 <?php
 function testing($source) {
-                unset($source[$cos]);
+    unset($source[$cos]);
 }
 testing($_GET);
 echo "ok\n";
 ?>
 --EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
+
 Notice: Undefined variable: cos in %sbug54585.php on line 3
 ok
index f0cfc74b0a9efcfb594960d8caab3bf017426b15..1186cd6a6fb96c8c941f531bbcdb4ae17af5416f 100644 (file)
@@ -15,5 +15,7 @@ f();
 
 ?>
 --EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
+
 Notice: Undefined variable: var in %s on line %d
 string(23) "Undefined variable: var"
index c121c1021acff2ac53360cc3565f0b847e102e6e..ae389db24874365cd108d8897cee61723384ac03 100644 (file)
@@ -14,6 +14,8 @@ test();
 
 ?>
 --EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
+
 Notice: Undefined variable: undef in %s on line %d
 
 Warning: A non-numeric value encountered in %s on line %d
index 8c49d365d21f0b0c0d264437c5c5de338e70486e..5636a532a4b0c50501189dc600ff7a469414d7da 100644 (file)
@@ -15,72 +15,71 @@ $password = 'password';
 $salt = 'salt';
 
 echo "\n-- Testing hash_pbkdf2() function with less than expected no. of arguments --\n";
-var_dump(@hash_pbkdf2());
-echo $php_errormsg . "\n";
-var_dump(@hash_pbkdf2('md5'));
-echo $php_errormsg . "\n";
-var_dump(@hash_pbkdf2('md5', $password));
-echo $php_errormsg . "\n";
-var_dump(@hash_pbkdf2('md5', $password, $salt));
-echo $php_errormsg . "\n";
+var_dump(hash_pbkdf2());
+var_dump(hash_pbkdf2('md5'));
+var_dump(hash_pbkdf2('md5', $password));
+var_dump(hash_pbkdf2('md5', $password, $salt));
 
 echo "\n-- Testing hash_pbkdf2() function with more than expected no. of arguments --\n";
-var_dump(@hash_pbkdf2('md5', $password, $salt, 10, 10, true, 'extra arg'));
-echo $php_errormsg . "\n";
+var_dump(hash_pbkdf2('md5', $password, $salt, 10, 10, true, 'extra arg'));
 
 echo "\n-- Testing hash_pbkdf2() function with invalid hash algorithm --\n";
-var_dump(@hash_pbkdf2('foo', $password, $salt, 1));
-echo $php_errormsg . "\n";
+var_dump(hash_pbkdf2('foo', $password, $salt, 1));
 
 echo "\n-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --\n";
-var_dump(@hash_pbkdf2('crc32', $password, $salt, 1));
-echo $php_errormsg . "\n";
+var_dump(hash_pbkdf2('crc32', $password, $salt, 1));
 
 echo "\n-- Testing hash_pbkdf2() function with invalid iterations --\n";
-var_dump(@hash_pbkdf2('md5', $password, $salt, 0));
-echo $php_errormsg . "\n";
-var_dump(@hash_pbkdf2('md5', $password, $salt, -1));
-echo $php_errormsg . "\n";
+var_dump(hash_pbkdf2('md5', $password, $salt, 0));
+var_dump(hash_pbkdf2('md5', $password, $salt, -1));
 
 echo "\n-- Testing hash_pbkdf2() function with invalid length --\n";
-var_dump(@hash_pbkdf2('md5', $password, $salt, 1, -1));
-echo $php_errormsg . "\n\n";
+var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1));
 
 ?>
 ===Done===
---EXPECT--
+--EXPECTF--
 *** Testing hash_pbkdf2() : error conditions ***
 
 -- Testing hash_pbkdf2() function with less than expected no. of arguments --
+
+Warning: hash_pbkdf2() expects at least 4 parameters, 0 given in %s on line %d
 NULL
-hash_pbkdf2() expects at least 4 parameters, 0 given
+
+Warning: hash_pbkdf2() expects at least 4 parameters, 1 given in %s on line %d
 NULL
-hash_pbkdf2() expects at least 4 parameters, 1 given
+
+Warning: hash_pbkdf2() expects at least 4 parameters, 2 given in %s on line %d
 NULL
-hash_pbkdf2() expects at least 4 parameters, 2 given
+
+Warning: hash_pbkdf2() expects at least 4 parameters, 3 given in %s on line %d
 NULL
-hash_pbkdf2() expects at least 4 parameters, 3 given
 
 -- Testing hash_pbkdf2() function with more than expected no. of arguments --
+
+Warning: hash_pbkdf2() expects at most 6 parameters, 7 given in %s on line %d
 NULL
-hash_pbkdf2() expects at most 6 parameters, 7 given
 
 -- Testing hash_pbkdf2() function with invalid hash algorithm --
+
+Warning: hash_pbkdf2(): Unknown hashing algorithm: foo in %s on line %d
 bool(false)
-hash_pbkdf2(): Unknown hashing algorithm: foo
 
 -- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --
+
+Warning: hash_pbkdf2(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
 bool(false)
-hash_pbkdf2(): Non-cryptographic hashing algorithm: crc32
 
 -- Testing hash_pbkdf2() function with invalid iterations --
+
+Warning: hash_pbkdf2(): Iterations must be a positive integer: 0 in %s on line %d
 bool(false)
-hash_pbkdf2(): Iterations must be a positive integer: 0
+
+Warning: hash_pbkdf2(): Iterations must be a positive integer: -1 in %s on line %d
 bool(false)
-hash_pbkdf2(): Iterations must be a positive integer: -1
 
 -- Testing hash_pbkdf2() function with invalid length --
-bool(false)
-hash_pbkdf2(): Length must be greater than or equal to 0: -1
 
+Warning: hash_pbkdf2(): Length must be greater than or equal to 0: -1 in %s on line %d
+bool(false)
 ===Done===
index 74f53a03772b7972bff8c2305db0a112644993e1..5b798cd5ba491a700438ce79052d53e86231f343 100644 (file)
@@ -45,8 +45,7 @@ shmop extension test
        echo "data in memory is: " . shmop_read($shm_id, 0, $written) . "\n";
        
        /* try to append data to the shared memory segment, this should fail */
-       @shmop_write($shm_id, $write_d1, $written);
-       echo $php_errormsg . "\n";
+       shmop_write($shm_id, $write_d1, $written);
 
        shmop_close($shm_id);
        
@@ -77,14 +76,15 @@ shmop extension test
        
        shmop_close($shm_id);
 ?>
---EXPECT--
+--EXPECTF--
 shm open for create: ok
 shm size is: 1024
 shm write test #1: ok
 data in memory is: test #1 of the shmop() extension
 shm open for read only: ok
 data in memory is: test #1 of the shmop() extension
-shmop_write(): trying to write to a read only segment
+
+Warning: shmop_write(): trying to write to a read only segment in %s on line %d
 shm open for read only: ok
 shm write test #1: ok
 data in memory is: test #1 of the shmop() extensiontest #2 append data to shared memory segment
index 36be0f395cfd7f87f1767f29ba5c21aa89b4e2e5..330ba2ff306384a0ac408310ff6adb3a8c7812b2 100644 (file)
@@ -1,10 +1,5 @@
 --TEST--
 implode() function
---INI--
-error_reporting=2047
-log_errors=0
-display_errors=0
-track_errors=1
 --FILE--
 <?php
 echo implode(array())."\n";
@@ -12,12 +7,10 @@ echo implode('nothing', array())."\n";
 echo implode(array('foo', 'bar', 'baz'))."\n";
 echo implode(':', array('foo', 'bar', 'baz'))."\n";
 echo implode(':', array('foo', array('bar', 'baz'), 'burp'))."\n";
-echo $php_errormsg."\n";
 ?>
 --EXPECTF--
-
-
 foobarbaz
 foo:bar:baz
+
+Notice: Array to string conversion in %s on line %d
 foo:Array:burp
-Array to string conversion
index ab01757efa4fc449567ce3b30ef3b91c31e19c1a..a8674a5d11784c3fcc1a5954acb09dbd40dbf4c2 100644 (file)
@@ -2311,8 +2311,9 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
                } directives[2] = {
                        {
                                E_DEPRECATED,
-                               "Directive '%s' is deprecated in PHP 5.3 and greater",
+                               "Directive '%s' is deprecated",
                                {
+                                       "track_errors",
                                        NULL
                                }
                        },
index bc4f7b529f634cd722f31b684ca7b06ee2d88f40..349434e78244629ff6aa13abfb5128287bb67cc9 100644 (file)
 ;   Development Value: Off
 ;   Production Value: Off
 
-; track_errors
-;   Default Value: Off
-;   Development Value: On
-;   Production Value: Off
-
 ; variables_order
 ;   Default Value: "EGPCS"
 ;   Development Value: "GPCS"
@@ -522,14 +517,13 @@ report_memleaks = On
 ; This setting is on by default.
 ;report_zend_debug = 0
 
-; Store the last error/warning message in $php_errormsg (boolean). Setting this value
-; to On can assist in debugging and is appropriate for development servers. It should
-; however be disabled on production servers.
+; Store the last error/warning message in $php_errormsg (boolean).
+; This directive is DEPRECATED.
 ; Default Value: Off
-; Development Value: On
+; Development Value: Off
 ; Production Value: Off
 ; http://php.net/track-errors
-track_errors = On
+track_errors = Off
 
 ; Turn off normal error reporting and emit XML-RPC error XML
 ; http://php.net/xmlrpc-errors
index a398610e11c7d2db4f3e868ad16097c5631cb179..32e68cad47c48c45493380ec139a13fcf31150ed 100755 (executable)
@@ -217,7 +217,7 @@ $ini_overwrites = array(
                'display_startup_errors=1',
                'log_errors=0',
                'html_errors=0',
-               'track_errors=1',
+               'track_errors=0',
                'report_memleaks=1',
                'report_zend_debug=0',
                'docref_root=',
index 07ad7a659b1e3de9e84f8d8233474b2b7430b650..ef644a4fb159fb7e9a30514c6fe828f749c40a05 100644 (file)
@@ -4,6 +4,8 @@ Error message handling (with ZendOpcache)
 <?php
 extension_loaded("Zend Opcache") or die("skip Zend Opcache is not loaded");
 ?>
+--INI--
+track_errors=1
 --FILE--
 <?php
 // If this test fails ask the developers of run-test.php
@@ -24,6 +26,7 @@ $error = 1 / $zero;
 var_dump($php_errormsg);
 ?>
 --EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
 string(1) "1"
 string(5) "32767"
 string(1) "0"
index 7d95d8937b43fe24aaa59ab07f45480f0e66d4c0..41d22d8e718dd6d7f1620971ab8245a3cff28013 100644 (file)
@@ -4,6 +4,8 @@ Error message handling (without ZendOpcache)
 <?php
 !extension_loaded("Zend Opcache") or die("skip Zend Opcache is loaded");
 ?>
+--INI--
+track_errors=1
 --FILE--
 <?php
 // If this test fails ask the developers of run-test.php
@@ -22,6 +24,7 @@ $error = 1 / 0;
 var_dump($php_errormsg);
 ?>
 --EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
 string(1) "1"
 string(5) "32767"
 string(1) "0"
index 7d7649adc01889c84a9adcce632c5d1201bb3b52..9814fa12f78395cc23d4c39a7cc23e482b7ca177 100644 (file)
@@ -4,6 +4,8 @@ Error message handling (with ZendOpcache)
 <?php
 if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is not loaded");
 ?>
+--INI--
+track_errors=1
 --FILE--
 <?php
 // If this test fails ask the developers of run-test.php
@@ -24,6 +26,7 @@ $error = 1 / $zero;
 var_dump($php_errormsg);
 ?>
 --EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
 string(1) "1"
 string(5) "32767"
 string(1) "0"