com php-src: Deprecate track_errors / $php_errormsg : Zend/tests/bug54585.phpt Zend/tests/bug6 7858.phpt Zend/tests/php_errormsg_misoptimizati on.phpt ext/hash/tests/hash_pbkdf2_error.phpt ext /shmop/tests/001.phpt ext/standard/tests/strings/impl ode.phpt main/main.c php.ini-development run-tests .php tests/run-test/test005.phpt tests/run-test/t est008.phpt tests/run-test/test008a.phpt

[email protected] (Nikita Popov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    c61daf415d0207abda6041a3ed12c23b6a9d8ebf
Author:    Nikita Popov <[email protected]>         Thu, 2 Feb 2017 21:15:36 +0100
Parents:   2df9346e7f9a0ecc204a1d615b5c151b8ed053f5
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=c61daf415d0207abda6041a3ed12c23b6a9d8ebf

Log:
Deprecate track_errors / $php_errormsg

Changed paths:
  M  Zend/tests/bug54585.phpt
  M  Zend/tests/bug67858.phpt
  M  Zend/tests/php_errormsg_misoptimization.phpt
  M  ext/hash/tests/hash_pbkdf2_error.phpt
  M  ext/shmop/tests/001.phpt
  M  ext/standard/tests/strings/implode.phpt
  M  main/main.c
  M  php.ini-development
  M  run-tests.php
  M  tests/run-test/test005.phpt
  M  tests/run-test/test008.phpt
  M  tests/run-test/test008a.phpt
diff_c61daf415d0207abda6041a3ed12c23b6a9d8ebf.txt (text/plain, 10.7 KB)
diff --git a/Zend/tests/bug54585.phpt b/Zend/tests/bug54585.phpt
index 2ca11f3..deabe55 100644
--- a/Zend/tests/bug54585.phpt
+++ b/Zend/tests/bug54585.phpt
@@ -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
diff --git a/Zend/tests/bug67858.phpt b/Zend/tests/bug67858.phpt
index f0cfc74..1186cd6 100644
--- a/Zend/tests/bug67858.phpt
+++ b/Zend/tests/bug67858.phpt
@@ -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"
diff --git a/Zend/tests/php_errormsg_misoptimization.phpt b/Zend/tests/php_errormsg_misoptimization.phpt
index c121c10..ae389db 100644
--- a/Zend/tests/php_errormsg_misoptimization.phpt
+++ b/Zend/tests/php_errormsg_misoptimization.phpt
@@ -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
diff --git a/ext/hash/tests/hash_pbkdf2_error.phpt b/ext/hash/tests/hash_pbkdf2_error.phpt
index 8c49d36..5636a53 100644
--- a/ext/hash/tests/hash_pbkdf2_error.phpt
+++ b/ext/hash/tests/hash_pbkdf2_error.phpt
@@ -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===
diff --git a/ext/shmop/tests/001.phpt b/ext/shmop/tests/001.phpt
index 74f53a0..5b798cd 100644
--- a/ext/shmop/tests/001.phpt
+++ b/ext/shmop/tests/001.phpt
@@ -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
diff --git a/ext/standard/tests/strings/implode.phpt b/ext/standard/tests/strings/implode.phpt
index 36be0f3..330ba2f 100644
--- a/ext/standard/tests/strings/implode.phpt
+++ b/ext/standard/tests/strings/implode.phpt
@@ -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
diff --git a/main/main.c b/main/main.c
index ab01757..a8674a5 100644
--- a/main/main.c
+++ b/main/main.c
@@ -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
 				}
 			},
diff --git a/php.ini-development b/php.ini-development
index bc4f7b5..349434e 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -153,11 +153,6 @@
 ;   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
diff --git a/run-tests.php b/run-tests.php
index a398610..32e68ca 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -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=',
diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt
index 07ad7a6..ef644a4 100644
--- a/tests/run-test/test005.phpt
+++ b/tests/run-test/test005.phpt
@@ -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"
diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt
index 7d95d89..41d22d8 100644
--- a/tests/run-test/test008.phpt
+++ b/tests/run-test/test008.phpt
@@ -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"
diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt
index 7d7649a..9814fa1 100644
--- a/tests/run-test/test008a.phpt
+++ b/tests/run-test/test008a.phpt
@@ -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"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.