2 changed files with 58 additions and 2 deletions
@ -0,0 +1,36 @@ |
|||
--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 in %sbug37811.php on line %d |
|||
|
|||
Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d |
|||
string(3) "Baz" |
|||
===DONE=== |
|||
--UEXPECTF-- |
|||
unicode(3) "Foo" |
|||
|
|||
Warning: Constants may only evaluate to scalar values in %sbug37811.php on line %d |
|||
|
|||
Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d |
|||
unicode(3) "Baz" |
|||
===DONE=== |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue