summaryrefslogtreecommitdiff
path: root/Zend/tests/bug37811.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug37811.phpt')
-rwxr-xr-xZend/tests/bug37811.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt
new file mode 100755
index 000000000..dc3ef93d6
--- /dev/null
+++ b/Zend/tests/bug37811.phpt
@@ -0,0 +1,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===