2006-07-09 22:45:11 +00:00
|
|
|
--TEST--
|
2007-05-07 17:54:12 +00:00
|
|
|
Bug #37811 (define not using toString on objects)
|
2006-07-09 22:45:11 +00:00
|
|
|
--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"
|
|
|
|
|
2014-12-21 03:03:49 +00:00
|
|
|
Warning: Constants may only evaluate to scalar values or arrays in %sbug37811.php on line %d
|
2006-07-09 22:45:11 +00:00
|
|
|
|
|
|
|
Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d
|
|
|
|
string(3) "Baz"
|
|
|
|
===DONE===
|