mirror of
https://github.com/php/php-src.git
synced 2024-09-28 21:36:12 +00:00
1b565f1393
Implements RFC "Deprecate and Remove Bareword (Unquoted) Strings" [https://wiki.php.net/rfc/deprecate-bareword-strings]
19 lines
435 B
PHP
19 lines
435 B
PHP
--TEST--
|
|
Defining constants with non-scalar values
|
|
--FILE--
|
|
<?php
|
|
|
|
define('foo', new stdClass);
|
|
var_dump(foo);
|
|
|
|
define('foo', fopen(__FILE__, 'r'));
|
|
var_dump(foo);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Constants may only evaluate to scalar values or arrays 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)
|