3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function bar() { $nothing = isset($this) ? 'Instance' : 'Class', "\n"; } } class Baz { function test() { $objDateTime = new DateTime('NOW'); echo 'Baz->test()::DEBUT: ' . $objDateTime->format('c'); for($index=1; $index <10000; $index++) { Foo::bar(); } $objDateTime = new DateTime('NOW'); echo 'Baz->test()::FIN: ' . $objDateTime->format('c'); } } $baz = new Baz; $baz->test(); class FooPropre { public static function barPropre() { $nothing = isset($this) ? 'Instance' : 'Class', "\n"; } } class BazPropre { function testPropre() { $objDateTime = new DateTime('NOW'); echo 'BazPropre->testPropre()::DEBUT: ' . $objDateTime->format('c'); for($index=1; $index <10000; $index++) { FooPropre::barPropre(); } $objDateTime = new DateTime('NOW'); echo 'BazPropre->testPropre()::FIN: ' . $objDateTime->format('c'); } } $baz = new BazPropre; $baz->testPropre();
Output for 5.3.0 - 5.4.23
Parse error: syntax error, unexpected ',' in /in/0sVht on line 4
Process exited with code 255.