summaryrefslogtreecommitdiff
path: root/Zend/tests/bug37811.phpt
blob: 70c4c90ede8cbf2efe0251c432d431c4f60e460e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--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===