mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
1b565f1393
Implements RFC "Deprecate and Remove Bareword (Unquoted) Strings" [https://wiki.php.net/rfc/deprecate-bareword-strings]
29 lines
531 B
PHP
29 lines
531 B
PHP
--TEST--
|
|
Bug #37811 (define not using toString on objects)
|
|
--FILE--
|
|
<?php
|
|
|
|
class TestClass
|
|
{
|
|
function __toString()
|
|
{
|
|
return "Foo";
|
|
}
|
|
}
|
|
|
|
define("Bar",new TestClass);
|
|
var_dump(Bar);
|
|
define("Baz",new stdClass);
|
|
var_dump(Baz);
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
string(3) "Foo"
|
|
|
|
Warning: Constants may only evaluate to scalar values or arrays 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===
|