mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Deprecate track_errors / $php_errormsg
This commit is contained in:
parent
2df9346e7f
commit
c61daf415d
12 changed files with 60 additions and 58 deletions
|
@ -5,11 +5,13 @@ track_errors=On
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
function testing($source) {
|
function testing($source) {
|
||||||
unset($source[$cos]);
|
unset($source[$cos]);
|
||||||
}
|
}
|
||||||
testing($_GET);
|
testing($_GET);
|
||||||
echo "ok\n";
|
echo "ok\n";
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||||
|
|
||||||
Notice: Undefined variable: cos in %sbug54585.php on line 3
|
Notice: Undefined variable: cos in %sbug54585.php on line 3
|
||||||
ok
|
ok
|
||||||
|
|
|
@ -15,5 +15,7 @@ f();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||||
|
|
||||||
Notice: Undefined variable: var in %s on line %d
|
Notice: Undefined variable: var in %s on line %d
|
||||||
string(23) "Undefined variable: var"
|
string(23) "Undefined variable: var"
|
||||||
|
|
|
@ -14,6 +14,8 @@ test();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||||
|
|
||||||
Notice: Undefined variable: undef in %s on line %d
|
Notice: Undefined variable: undef in %s on line %d
|
||||||
|
|
||||||
Warning: A non-numeric value encountered in %s on line %d
|
Warning: A non-numeric value encountered in %s on line %d
|
||||||
|
|
|
@ -15,72 +15,71 @@ $password = 'password';
|
||||||
$salt = 'salt';
|
$salt = 'salt';
|
||||||
|
|
||||||
echo "\n-- Testing hash_pbkdf2() function with less than expected no. of arguments --\n";
|
echo "\n-- Testing hash_pbkdf2() function with less than expected no. of arguments --\n";
|
||||||
var_dump(@hash_pbkdf2());
|
var_dump(hash_pbkdf2());
|
||||||
echo $php_errormsg . "\n";
|
var_dump(hash_pbkdf2('md5'));
|
||||||
var_dump(@hash_pbkdf2('md5'));
|
var_dump(hash_pbkdf2('md5', $password));
|
||||||
echo $php_errormsg . "\n";
|
var_dump(hash_pbkdf2('md5', $password, $salt));
|
||||||
var_dump(@hash_pbkdf2('md5', $password));
|
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
var_dump(@hash_pbkdf2('md5', $password, $salt));
|
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
|
|
||||||
echo "\n-- Testing hash_pbkdf2() function with more than expected no. of arguments --\n";
|
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'));
|
var_dump(hash_pbkdf2('md5', $password, $salt, 10, 10, true, 'extra arg'));
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
|
|
||||||
echo "\n-- Testing hash_pbkdf2() function with invalid hash algorithm --\n";
|
echo "\n-- Testing hash_pbkdf2() function with invalid hash algorithm --\n";
|
||||||
var_dump(@hash_pbkdf2('foo', $password, $salt, 1));
|
var_dump(hash_pbkdf2('foo', $password, $salt, 1));
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
|
|
||||||
echo "\n-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --\n";
|
echo "\n-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --\n";
|
||||||
var_dump(@hash_pbkdf2('crc32', $password, $salt, 1));
|
var_dump(hash_pbkdf2('crc32', $password, $salt, 1));
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
|
|
||||||
echo "\n-- Testing hash_pbkdf2() function with invalid iterations --\n";
|
echo "\n-- Testing hash_pbkdf2() function with invalid iterations --\n";
|
||||||
var_dump(@hash_pbkdf2('md5', $password, $salt, 0));
|
var_dump(hash_pbkdf2('md5', $password, $salt, 0));
|
||||||
echo $php_errormsg . "\n";
|
var_dump(hash_pbkdf2('md5', $password, $salt, -1));
|
||||||
var_dump(@hash_pbkdf2('md5', $password, $salt, -1));
|
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
|
|
||||||
echo "\n-- Testing hash_pbkdf2() function with invalid length --\n";
|
echo "\n-- Testing hash_pbkdf2() function with invalid length --\n";
|
||||||
var_dump(@hash_pbkdf2('md5', $password, $salt, 1, -1));
|
var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1));
|
||||||
echo $php_errormsg . "\n\n";
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
===Done===
|
===Done===
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
*** Testing hash_pbkdf2() : error conditions ***
|
*** Testing hash_pbkdf2() : error conditions ***
|
||||||
|
|
||||||
-- Testing hash_pbkdf2() function with less than expected no. of arguments --
|
-- 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
|
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
|
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
|
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
|
NULL
|
||||||
hash_pbkdf2() expects at least 4 parameters, 3 given
|
|
||||||
|
|
||||||
-- Testing hash_pbkdf2() function with more than expected no. of arguments --
|
-- 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
|
NULL
|
||||||
hash_pbkdf2() expects at most 6 parameters, 7 given
|
|
||||||
|
|
||||||
-- Testing hash_pbkdf2() function with invalid hash algorithm --
|
-- Testing hash_pbkdf2() function with invalid hash algorithm --
|
||||||
|
|
||||||
|
Warning: hash_pbkdf2(): Unknown hashing algorithm: foo in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
hash_pbkdf2(): Unknown hashing algorithm: foo
|
|
||||||
|
|
||||||
-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --
|
-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --
|
||||||
|
|
||||||
|
Warning: hash_pbkdf2(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
hash_pbkdf2(): Non-cryptographic hashing algorithm: crc32
|
|
||||||
|
|
||||||
-- Testing hash_pbkdf2() function with invalid iterations --
|
-- Testing hash_pbkdf2() function with invalid iterations --
|
||||||
|
|
||||||
|
Warning: hash_pbkdf2(): Iterations must be a positive integer: 0 in %s on line %d
|
||||||
bool(false)
|
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)
|
bool(false)
|
||||||
hash_pbkdf2(): Iterations must be a positive integer: -1
|
|
||||||
|
|
||||||
-- Testing hash_pbkdf2() function with invalid length --
|
-- 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===
|
===Done===
|
||||||
|
|
|
@ -45,8 +45,7 @@ shmop extension test
|
||||||
echo "data in memory is: " . shmop_read($shm_id, 0, $written) . "\n";
|
echo "data in memory is: " . shmop_read($shm_id, 0, $written) . "\n";
|
||||||
|
|
||||||
/* try to append data to the shared memory segment, this should fail */
|
/* try to append data to the shared memory segment, this should fail */
|
||||||
@shmop_write($shm_id, $write_d1, $written);
|
shmop_write($shm_id, $write_d1, $written);
|
||||||
echo $php_errormsg . "\n";
|
|
||||||
|
|
||||||
shmop_close($shm_id);
|
shmop_close($shm_id);
|
||||||
|
|
||||||
|
@ -77,14 +76,15 @@ shmop extension test
|
||||||
|
|
||||||
shmop_close($shm_id);
|
shmop_close($shm_id);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
shm open for create: ok
|
shm open for create: ok
|
||||||
shm size is: 1024
|
shm size is: 1024
|
||||||
shm write test #1: ok
|
shm write test #1: ok
|
||||||
data in memory is: test #1 of the shmop() extension
|
data in memory is: test #1 of the shmop() extension
|
||||||
shm open for read only: ok
|
shm open for read only: ok
|
||||||
data in memory is: test #1 of the shmop() extension
|
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 open for read only: ok
|
||||||
shm write test #1: ok
|
shm write test #1: ok
|
||||||
data in memory is: test #1 of the shmop() extensiontest #2 append data to shared memory segment
|
data in memory is: test #1 of the shmop() extensiontest #2 append data to shared memory segment
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
implode() function
|
implode() function
|
||||||
--INI--
|
|
||||||
error_reporting=2047
|
|
||||||
log_errors=0
|
|
||||||
display_errors=0
|
|
||||||
track_errors=1
|
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
echo implode(array())."\n";
|
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', 'bar', 'baz'))."\n";
|
echo implode(':', array('foo', 'bar', 'baz'))."\n";
|
||||||
echo implode(':', array('foo', array('bar', 'baz'), 'burp'))."\n";
|
echo implode(':', array('foo', array('bar', 'baz'), 'burp'))."\n";
|
||||||
echo $php_errormsg."\n";
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
|
||||||
|
|
||||||
foobarbaz
|
foobarbaz
|
||||||
foo:bar:baz
|
foo:bar:baz
|
||||||
|
|
||||||
|
Notice: Array to string conversion in %s on line %d
|
||||||
foo:Array:burp
|
foo:Array:burp
|
||||||
Array to string conversion
|
|
||||||
|
|
|
@ -2311,8 +2311,9 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
|
||||||
} directives[2] = {
|
} directives[2] = {
|
||||||
{
|
{
|
||||||
E_DEPRECATED,
|
E_DEPRECATED,
|
||||||
"Directive '%s' is deprecated in PHP 5.3 and greater",
|
"Directive '%s' is deprecated",
|
||||||
{
|
{
|
||||||
|
"track_errors",
|
||||||
NULL
|
NULL
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -153,11 +153,6 @@
|
||||||
; Development Value: Off
|
; Development Value: Off
|
||||||
; Production Value: Off
|
; Production Value: Off
|
||||||
|
|
||||||
; track_errors
|
|
||||||
; Default Value: Off
|
|
||||||
; Development Value: On
|
|
||||||
; Production Value: Off
|
|
||||||
|
|
||||||
; variables_order
|
; variables_order
|
||||||
; Default Value: "EGPCS"
|
; Default Value: "EGPCS"
|
||||||
; Development Value: "GPCS"
|
; Development Value: "GPCS"
|
||||||
|
@ -522,14 +517,13 @@ report_memleaks = On
|
||||||
; This setting is on by default.
|
; This setting is on by default.
|
||||||
;report_zend_debug = 0
|
;report_zend_debug = 0
|
||||||
|
|
||||||
; Store the last error/warning message in $php_errormsg (boolean). Setting this value
|
; Store the last error/warning message in $php_errormsg (boolean).
|
||||||
; to On can assist in debugging and is appropriate for development servers. It should
|
; This directive is DEPRECATED.
|
||||||
; however be disabled on production servers.
|
|
||||||
; Default Value: Off
|
; Default Value: Off
|
||||||
; Development Value: On
|
; Development Value: Off
|
||||||
; Production Value: Off
|
; Production Value: Off
|
||||||
; http://php.net/track-errors
|
; http://php.net/track-errors
|
||||||
track_errors = On
|
track_errors = Off
|
||||||
|
|
||||||
; Turn off normal error reporting and emit XML-RPC error XML
|
; Turn off normal error reporting and emit XML-RPC error XML
|
||||||
; http://php.net/xmlrpc-errors
|
; http://php.net/xmlrpc-errors
|
||||||
|
|
|
@ -217,7 +217,7 @@ $ini_overwrites = array(
|
||||||
'display_startup_errors=1',
|
'display_startup_errors=1',
|
||||||
'log_errors=0',
|
'log_errors=0',
|
||||||
'html_errors=0',
|
'html_errors=0',
|
||||||
'track_errors=1',
|
'track_errors=0',
|
||||||
'report_memleaks=1',
|
'report_memleaks=1',
|
||||||
'report_zend_debug=0',
|
'report_zend_debug=0',
|
||||||
'docref_root=',
|
'docref_root=',
|
||||||
|
|
|
@ -4,6 +4,8 @@ Error message handling (with ZendOpcache)
|
||||||
<?php
|
<?php
|
||||||
extension_loaded("Zend Opcache") or die("skip Zend Opcache is not loaded");
|
extension_loaded("Zend Opcache") or die("skip Zend Opcache is not loaded");
|
||||||
?>
|
?>
|
||||||
|
--INI--
|
||||||
|
track_errors=1
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
// If this test fails ask the developers of run-test.php
|
// If this test fails ask the developers of run-test.php
|
||||||
|
@ -24,6 +26,7 @@ $error = 1 / $zero;
|
||||||
var_dump($php_errormsg);
|
var_dump($php_errormsg);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||||
string(1) "1"
|
string(1) "1"
|
||||||
string(5) "32767"
|
string(5) "32767"
|
||||||
string(1) "0"
|
string(1) "0"
|
||||||
|
|
|
@ -4,6 +4,8 @@ Error message handling (without ZendOpcache)
|
||||||
<?php
|
<?php
|
||||||
!extension_loaded("Zend Opcache") or die("skip Zend Opcache is loaded");
|
!extension_loaded("Zend Opcache") or die("skip Zend Opcache is loaded");
|
||||||
?>
|
?>
|
||||||
|
--INI--
|
||||||
|
track_errors=1
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
// If this test fails ask the developers of run-test.php
|
// If this test fails ask the developers of run-test.php
|
||||||
|
@ -22,6 +24,7 @@ $error = 1 / 0;
|
||||||
var_dump($php_errormsg);
|
var_dump($php_errormsg);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||||
string(1) "1"
|
string(1) "1"
|
||||||
string(5) "32767"
|
string(5) "32767"
|
||||||
string(1) "0"
|
string(1) "0"
|
||||||
|
|
|
@ -4,6 +4,8 @@ Error message handling (with ZendOpcache)
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is not loaded");
|
if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is not loaded");
|
||||||
?>
|
?>
|
||||||
|
--INI--
|
||||||
|
track_errors=1
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
// If this test fails ask the developers of run-test.php
|
// If this test fails ask the developers of run-test.php
|
||||||
|
@ -24,6 +26,7 @@ $error = 1 / $zero;
|
||||||
var_dump($php_errormsg);
|
var_dump($php_errormsg);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||||
string(1) "1"
|
string(1) "1"
|
||||||
string(5) "32767"
|
string(5) "32767"
|
||||||
string(1) "0"
|
string(1) "0"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue