3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function bar() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class Baz { function test() { $objDateTime = new DateTime('NOW'); $debut = $objDateTime->getTimeStamp() for($index=1; $index <100; $index++) { Foo::bar(); } $objDateTime = new DateTime('NOW'); $fin = $objDateTime->getTimeStamp() echo 'Baz->test()::' . $fin-$debut; } } $baz = new Baz; $baz->test(); class FooPropre { public static function barPropre() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class BazPropre { function testPropre() { $objDateTime = new DateTime('NOW'); $debut = $objDateTime->getTimeStamp() for($index=1; $index <100; $index++) { FooPropre::barPropre(); } $objDateTime = new DateTime('NOW'); $fin = $objDateTime->getTimeStamp() echo 'BazPropre->testPropre()::' . $fin-$debut; } } $bazp = new BazPropre; $bazp->testPropre();
Output for 5.4.0 - 5.5.7
Parse error: syntax error, unexpected 'for' (T_FOR) in /in/o9KfC on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_FOR in /in/o9KfC on line 11
Process exited with code 255.