php.exe). (Michele Locati)
. Implemented "Convert numeric keys in object/array casts" RFC, fixes
bugs #53838, #61655, #66173, #70925, #72254, etc. (Andrea)
+ . Implemented "Deprecate and Remove Bareword (Unquoted) Strings" RFC.
+ (Rowan Collins)
. Raised minimum supported Windows versions to Windows 7/Server 2008 R2.
(Anatol)
. Implemented minor optimization in array_keys/array_values(). (Sara)
/^(0|(-?[1-9][0-9]*))$/ where PHP_INT_MIN <= n <= PHP_INT_MAX) to integer
keys. This fixes the behaviour of previous versions, where numeric string
property names would become inaccessible string keys.
+ . Unqualified references to undefined constants now generate a Warning instead
+ of a notice. They will generate an Error in a future version of PHP.
+ (https://wiki.php.net/rfc/deprecate-bareword-strings)
. Minimum supported Windows versions are Windows 7/Server 2008 R2.
- BCMath:
Warning: Constants may only evaluate to scalar values or arrays in %sbug37811.php on line %d
-Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d
+Warning: Use of undefined constant Baz - assumed 'Baz' (this will throw an Error in a future version of PHP) in %sbug37811.php on line %d
string(3) "Baz"
===DONE===
echo f3()."\n";
?>
--EXPECTF--
-Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 13
+Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 13
bar
-Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 3
+Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 3
bar
-Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 6
+Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 6
bar
-Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 9
+Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 9
bar
?>
--EXPECTF--
-Notice: Use of undefined constant FOO - assumed 'FOO' in %s on line %d
+Warning: Use of undefined constant FOO - assumed 'FOO' (this will throw an Error in a future version of PHP) in %s on line %d
c . 10;
?>
--EXPECTF--
-Notice: Use of undefined constant c - assumed 'c' in %sbug69755.php on line 2
+Warning: Use of undefined constant c - assumed 'c' (this will throw an Error in a future version of PHP) in %sbug69755.php on line 2
--EXPECTF--
Notice: Array to string conversion in %s on line %d
-Notice: Use of undefined constant t - assumed 't' in %s on line %d
+Warning: Use of undefined constant t - assumed 't' (this will throw an Error in a future version of PHP) in %s on line %d
echo "OK\n";
?>
--EXPECTF--
-Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
+Warning: Use of undefined constant e - assumed 'e' (this will throw an Error in a future version of PHP) in %sbug72944.php on line 2
Notice: Undefined variable: A in %sbug72944.php on line 2
OK
?>
--EXPECTF--
-Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d
+Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' (this will throw an Error in a future version of PHP) in %s:%d
Stack trace:
#0 %s(%d): {closure}(%s)
#1 %s(%d): doSomething()
--EXPECTF--
Warning: Constants may only evaluate to scalar values or arrays in %s on line %d
-Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
+Warning: Use of undefined constant foo - assumed 'foo' (this will throw an Error in a future version of PHP) in %s on line %d
string(%d) "foo"
resource(%d) of type (stream)
var_dump(ZEND_THREAD_safe);
?>
--EXPECTF--
-Notice: Use of undefined constant ZEND_THREAD_safe - assumed 'ZEND_THREAD_safe' in %s on line %d
+Warning: Use of undefined constant ZEND_THREAD_safe - assumed 'ZEND_THREAD_safe' (this will throw an Error in a future version of PHP) in %s on line %d
string(16) "ZEND_THREAD_safe"
int(123)
ok
ok
-Notice: Use of undefined constant BAR - assumed 'BAR' in %sns_041.php on line 9
+Warning: Use of undefined constant BAR - assumed 'BAR' (this will throw an Error in a future version of PHP) in %sns_041.php on line 9
BAR
var_dump($a);
echo \unknown;
--EXPECTF--
-Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d
+Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d
-Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d
+Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d
-Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d
+Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d
unknown
array(1) {
["unknown"]=>
actual_len -= (actual - Z_STRVAL_P(p));
}
- zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
+ zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)", actual, actual);
if (EG(exception)) {
RESET_CONSTANT_VISITED(p);
return FAILURE;
actual, Z_STRLEN_P(EX_CONSTANT(opline->op2)) - (actual - Z_STRVAL_P(EX_CONSTANT(opline->op2))));
}
/* non-qualified constant - allow text substitution */
- zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
+ zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)",
Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
actual, Z_STRLEN_P(EX_CONSTANT(opline->op2)) - (actual - Z_STRVAL_P(EX_CONSTANT(opline->op2))));
}
/* non-qualified constant - allow text substitution */
- zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
+ zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)",
Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
function getA() {return A;}
?>
--EXPECTF--
-Notice: Use of undefined constant A - assumed 'A' in %sbug66251.php on line 4
+Warning: Use of undefined constant A - assumed 'A' (this will throw an Error in a future version of PHP) in %sbug66251.php on line 4
A=A
?>
okey
--EXPECTF--
-Notice: Use of undefined constant E - assumed 'E' in %sbug71843.php on line %d
+Warning: Use of undefined constant E - assumed 'E' (this will throw an Error in a future version of PHP) in %sbug71843.php on line %d
Warning: A non-numeric value encountered in %s on line %d
-Notice: Use of undefined constant R - assumed 'R' in %sbug71843.php on line %d
+Warning: Use of undefined constant R - assumed 'R' (this will throw an Error in a future version of PHP) in %sbug71843.php on line %d
Warning: A non-numeric value encountered in %s on line %d
-Notice: Use of undefined constant See - assumed 'See' in %sbug71843.php on line %d
+Warning: Use of undefined constant See - assumed 'See' (this will throw an Error in a future version of PHP) in %sbug71843.php on line %d
okey
Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
NULL
-Notice: Use of undefined constant unknown_function - assumed 'unknown_function' in %s on line %d
+Warning: Use of undefined constant unknown_function - assumed 'unknown_function' (this will throw an Error in a future version of PHP) in %s on line %d
Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
NULL
Warning: array_intersect_uassoc() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
NULL
-Notice: Use of undefined constant unknown_function - assumed 'unknown_function' in %s on line %d
+Warning: Use of undefined constant unknown_function - assumed 'unknown_function' (this will throw an Error in a future version of PHP) in %s on line %d
Warning: array_intersect_uassoc() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
NULL
Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
NULL
-Notice: Use of undefined constant unknown_function - assumed 'unknown_function' in %s on line %d
+Warning: Use of undefined constant unknown_function - assumed 'unknown_function' (this will throw an Error in a future version of PHP) in %s on line %d
Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
NULL
Warning: count() expects at most 2 parameters, 3 given in %s on line %d
NULL
-Notice: Use of undefined constant ABCD - assumed 'ABCD' in %s on line %d
+Warning: Use of undefined constant ABCD - assumed 'ABCD' (this will throw an Error in a future version of PHP) in %s on line %d
Warning: count() expects parameter 2 to be integer, %s given in %s on line %d
NULL
--EXPECTF--
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
-Notice: Use of undefined constant threemeninaboat - assumed 'threemeninaboat' in %s(9) : assert code on line 1
+Warning: Use of undefined constant threemeninaboat - assumed 'threemeninaboat' (this will throw an Error in a future version of PHP) in %s(9) : assert code on line 1
bool(true)
int(0)
Notice: Undefined variable: undefined_var in %s on line %d
-Notice: Use of undefined constant undefined_constant - assumed 'undefined_constant' in %s on line %d
+Warning: Use of undefined constant undefined_constant - assumed 'undefined_constant' (this will throw an Error in a future version of PHP) in %s on line %d
array(0) {
}
array(0) {
--FILE--
<?php
include "php_cli_server.inc";
-php_cli_server_start('echo done, "\n";', null);
+php_cli_server_start('echo "done\n";', null);
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
$port = intval($port)?:80;
Attempt to access various kinds of class constants:
-Notice: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s on line %d
+Warning: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' (this will throw an Error in a future version of PHP) in %s on line %d
string(9) "UNDEFINED"
int(1)
float(1.5)
?>
--EXPECTF--
-Notice: Use of undefined constant FATAL - assumed 'FATAL' in %sconstants_scope_001.php on line %d
+Warning: Use of undefined constant FATAL - assumed 'FATAL' (this will throw an Error in a future version of PHP) in %sconstants_scope_001.php on line %d
FATAL = FATAL
self::FATAL = Fatal error
self::FATAL = Worst error