3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Bar { public $foo = 1; } $Obj1 = new Bar( Foo.bar() ); // Foo нигде не определен! Он должен вызвать фатал $Obj2 = new stdClass( getFoo( $Obj1 ) ); // getFoo() не существует, почему он работает? var_dump($Obj1, $Obj2);
based on VTBen
Output for 7.2.0
Warning: Use of undefined constant Foo - assumed 'Foo' (this will throw an Error in a future version of PHP) in /in/U5os9 on line 6 Fatal error: Uncaught Error: Call to undefined function bar() in /in/U5os9:6 Stack trace: #0 {main} thrown in /in/U5os9 on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.10
Notice: Use of undefined constant Foo - assumed 'Foo' in /in/U5os9 on line 6 Fatal error: Uncaught Error: Call to undefined function bar() in /in/U5os9:6 Stack trace: #0 {main} thrown in /in/U5os9 on line 6
Process exited with code 255.
Output for 5.3.18 - 7.0.20
object(Bar)#1 (1) { ["foo"]=> int(1) } object(stdClass)#2 (0) { }