xref: /PHP-7.1/tests/lang/bug7515.phpt (revision f9b80883)
1--TEST--
2Bug #7515 (weird & invisible referencing of objects)
3--SKIPIF--
4<?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2 needed\n"; ?>
5--INI--
6error_reporting=2039
7--FILE--
8<?php
9class obj {
10	function method() {}
11}
12
13$o->root=new obj();
14
15ob_start();
16var_dump($o);
17$x=ob_get_contents();
18ob_end_clean();
19
20$o->root->method();
21
22ob_start();
23var_dump($o);
24$y=ob_get_contents();
25ob_end_clean();
26if ($x == $y) {
27    print "success";
28} else {
29    print "failure
30x=$x
31y=$y
32";
33}
34?>
35--EXPECTF--
36Warning: Creating default object from empty value in %s on line %d
37success
38