3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class SomeObj { public function doTest() {} } $someObj = new SomeObj; class SomeClass { public static function doTest() {;} } function something_doTest() {} // bench static method $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) SomeClass::doTest($i); echo "Static Time: " , (microtime(true)-$starttime) , " ms\n"; // bench object method $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) $someObj->doTest($i); echo "Object Time: " , (microtime(true)-$starttime) , " ms\n"; // bench function $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) something_doTest($i); echo "Function Time: " , (microtime(true)-$starttime) , " ms\n";
Output for 7.2.0
Static Time: 0.28656697273254 ms Object Time: 0.31152486801147 ms Function Time: 0.22454595565796 ms
Output for 7.1.7
Static Time: 0.3401939868927 ms Object Time: 0.38247394561768 ms Function Time: 0.26374006271362 ms
Output for 7.1.6
Static Time: 0.31153202056885 ms Object Time: 0.36230897903442 ms Function Time: 0.25156688690186 ms
Output for 7.1.5
Static Time: 0.33982014656067 ms Object Time: 0.29639506340027 ms Function Time: 0.23841500282288 ms
Output for 7.1.0
Static Time: 0.30761790275574 ms Object Time: 0.27952814102173 ms Function Time: 0.12946605682373 ms
Output for 7.0.20
Static Time: 0.35654497146606 ms Object Time: 0.31964588165283 ms Function Time: 0.25818514823914 ms
Output for 7.0.14
Static Time: 0.32327604293823 ms Object Time: -0.18855905532837 ms Function Time: -0.22388315200806 ms
Output for 7.0.6
Static Time: 0.28897905349731 ms Object Time: 0.30607104301453 ms Function Time: 0.23668003082275 ms
Output for 7.0.5
Static Time: 0.31111216545105 ms Object Time: 0.3135130405426 ms Function Time: 0.24157905578613 ms
Output for 7.0.4
Static Time: 0.32585096359253 ms Object Time: 0.33228993415833 ms Function Time: 0.24529504776001 ms
Output for 7.0.3
Static Time: 0.3021399974823 ms Object Time: 0.32388091087341 ms Function Time: 0.23988890647888 ms
Output for 7.0.2
Static Time: 0.30119705200195 ms Object Time: 0.32229900360107 ms Function Time: 0.23812985420227 ms
Output for 7.0.1
Static Time: 0.29532098770142 ms Object Time: 0.32109308242798 ms Function Time: 0.23645710945129 ms
Output for 7.0.0
Static Time: 0.30480098724365 ms Object Time: 0.31444692611694 ms Function Time: 0.24017596244812 ms
Output for 5.6.28
Static Time: -0.69240188598633 ms Object Time: 1.1907069683075 ms Function Time: 1.275820016861 ms
Output for 5.6.21
Static Time: 0.72771000862122 ms Object Time: 0.81730484962463 ms Function Time: 0.66882491111755 ms
Output for 5.6.20
Static Time: 0.72667789459229 ms Object Time: 0.79436588287354 ms Function Time: 0.67171692848206 ms
Output for 5.6.19
Static Time: 0.73752903938293 ms Object Time: 0.79354691505432 ms Function Time: 0.66582608222961 ms
Output for 5.6.18
Static Time: 0.73451495170593 ms Object Time: 0.80938601493835 ms Function Time: 0.67979001998901 ms
Output for 5.6.17
Static Time: 0.71402287483215 ms Object Time: 0.79894709587097 ms Function Time: 0.67302823066711 ms
Output for 5.6.16
Static Time: 0.75779008865356 ms Object Time: 0.82555913925171 ms Function Time: 0.7098970413208 ms
Output for 5.6.15
Static Time: 0.74798083305359 ms Object Time: 0.83289003372192 ms Function Time: 0.68448781967163 ms
Output for 5.6.14
Static Time: 0.74599695205688 ms Object Time: 0.82634496688843 ms Function Time: 0.67762589454651 ms
Output for 5.6.13
Static Time: 0.73212385177612 ms Object Time: 0.79441499710083 ms Function Time: 0.66334295272827 ms
Output for 5.6.12
Static Time: 0.80640411376953 ms Object Time: 0.80222296714783 ms Function Time: 0.66771602630615 ms
Output for 5.6.11
Static Time: 0.72839784622192 ms Object Time: 0.79934811592102 ms Function Time: 0.67285704612732 ms
Output for 5.6.10
Static Time: 0.71633100509644 ms Object Time: 0.81299090385437 ms Function Time: 0.67697310447693 ms
Output for 5.6.9
Static Time: 0.73337602615356 ms Object Time: 0.80074191093445 ms Function Time: 0.66798496246338 ms
Output for 5.6.8
Static Time: 0.75860786437988 ms Object Time: 0.83555603027344 ms Function Time: 0.68376302719116 ms
Output for 5.5.35
Static Time: 0.7677481174469 ms Object Time: 0.68048095703125 ms Function Time: 0.56644296646118 ms
Output for 5.5.34
Static Time: 0.70121884346008 ms Object Time: 0.81127405166626 ms Function Time: 0.66576910018921 ms
Output for 5.5.33
Static Time: 0.71753191947937 ms Object Time: 0.791424036026 ms Function Time: 0.6890869140625 ms
Output for 5.5.32
Static Time: 0.72274804115295 ms Object Time: 0.82768511772156 ms Function Time: 0.69475722312927 ms
Output for 5.5.31
Static Time: 1.3225660324097 ms
Process exited with code 137.
Output for 5.5.30
Static Time: 0.71496796607971 ms Object Time: 0.78165698051453 ms Function Time: 0.67916488647461 ms
Output for 5.5.29
Static Time: 0.75388383865356 ms Object Time: 0.79016518592834 ms Function Time: 0.68951010704041 ms
Output for 5.5.28
Static Time: 0.7406849861145 ms Object Time: 0.78786206245422 ms Function Time: 0.65755677223206 ms
Output for 5.5.27
Static Time: 0.75701093673706 ms Object Time: 0.79845714569092 ms Function Time: 0.6638491153717 ms
Output for 5.5.26
Static Time: 0.69873309135437 ms Object Time: 0.79613280296326 ms Function Time: 0.65159893035889 ms
Output for 5.5.25
Static Time: 0.7225239276886 ms Object Time: 0.79093909263611 ms Function Time: 0.65938401222229 ms
Output for 5.5.24
Static Time: 0.75944590568542 ms Object Time: 0.68201899528503 ms Function Time: 0.56130504608154 ms
Output for 5.4.45
Static Time: 0.74172186851501 ms Object Time: 0.82037281990051 ms Function Time: 0.63567304611206 ms
Output for 5.4.44
Static Time: 0.69375991821289 ms Object Time: 0.78487706184387 ms Function Time: 0.92206001281738 ms
Output for 5.4.43
Static Time: 1.2563052177429 ms
Process exited with code 137.
Output for 5.4.42
Static Time: 1.4697740077972 ms
Process exited with code 137.
Output for 5.4.41
Static Time: 1.1323261260986 ms
Process exited with code 137.
Output for 5.4.40
Static Time: 0.74647617340088 ms Object Time: 0.96980404853821 ms
Process exited with code 137.
Output for 5.4.39
Static Time: 1.3210680484772 ms
Process exited with code 137.
Output for 5.4.38
Static Time: 1.6468110084534 ms
Process exited with code 137.
Output for 5.4.37
Static Time: 1.0476319789886 ms Object Time: 1.1995239257812 ms
Process exited with code 137.
Output for 5.4.36
Static Time: 1.1453189849854 ms
Process exited with code 137.
Output for 5.4.35
Static Time: 1.0151510238647 ms Object Time: 1.168023109436 ms
Process exited with code 137.
Output for 5.4.34
Static Time: 1.1659481525421 ms Object Time: 1.1588759422302 ms
Process exited with code 137.
Output for 5.4.32
Static Time: 1.1890230178833 ms
Process exited with code 137.
Output for 5.4.31
Static Time: 0.90970706939697 ms
Process exited with code 137.
Output for 5.4.30
Static Time: 0.73188495635986 ms Object Time: 0.83266711235046 ms
Process exited with code 137.
Output for 5.4.29
Static Time: 1.2144298553467 ms
Process exited with code 137.
Output for 5.4.28
Static Time: 0.92891907691956 ms
Process exited with code 137.
Output for 5.4.27
Static Time: 0.78909087181091 ms Object Time: 0.90655183792114 ms
Process exited with code 137.
Output for 5.4.26
Static Time: 1.0110490322113 ms Object Time: 1.181657075882 ms
Process exited with code 137.
Output for 5.4.25
Static Time: 1.2146091461182 ms
Process exited with code 137.
Output for 5.4.24
Static Time: 1.2802658081055 ms
Process exited with code 137.
Output for 5.4.23
Static Time: 1.1507902145386 ms
Process exited with code 137.
Output for 5.4.22
Static Time: 1.0798690319061 ms Object Time: 1.182450056076 ms
Process exited with code 137.
Output for 5.4.21
Static Time: 1.2226650714874 ms
Process exited with code 137.
Output for 5.4.20
Static Time: 1.3613941669464 ms
Process exited with code 137.
Output for 5.4.19
Static Time: 1.1221008300781 ms
Process exited with code 137.
Output for 5.4.18
Static Time: 1.7173631191254 ms
Process exited with code 137.
Output for 5.4.17
Static Time: 1.0654768943787 ms Object Time: 1.1657600402832 ms
Process exited with code 137.
Output for 5.4.16
Static Time: 1.140389919281 ms Object Time: 1.1580371856689 ms
Process exited with code 137.
Output for 5.4.15
Static Time: 1.1474039554596 ms Object Time: 1.2505989074707 ms
Process exited with code 137.
Output for 5.4.14
Static Time: 1.1695871353149 ms
Process exited with code 137.
Output for 5.4.13
Static Time: 1.1678950786591 ms
Process exited with code 137.
Output for 5.4.12
Static Time: 1.502730846405 ms
Process exited with code 137.
Output for 5.4.11
Could not open input file: /in/6aiug
Process exited with code 1.
Output for 5.4.10
Static Time: 1.2084379196167 ms
Process exited with code 137.
Output for 5.4.9
Static Time: 1.2815039157867 ms
Process exited with code 137.
Output for 5.4.8
Static Time: 1.2077629566193 ms Object Time: 1.2197749614716 ms
Process exited with code 137.
Output for 5.4.7
Static Time: 1.0537419319153 ms
Process exited with code 137.
Output for 5.4.6
Static Time: 1.0757369995117 ms
Process exited with code 137.
Output for 5.4.5
Static Time: 1.1519718170166 ms
Process exited with code 137.
Output for 5.4.4
Static Time: 1.0737919807434 ms
Process exited with code 137.
Output for 5.4.3
Static Time: 1.109836101532 ms Object Time: 1.2366309165955 ms
Process exited with code 137.
Output for 5.4.2
Static Time: 1.1986570358276 ms
Process exited with code 137.
Output for 5.4.1
Static Time: 1.4247951507568 ms
Process exited with code 137.
Output for 5.4.0
Static Time: 1.3745839595795 ms
Process exited with code 137.
Output for 5.0.0 - 5.3.7, 5.3.9 - 5.3.15, 5.3.17 - 5.3.29

Process exited with code 137.
Output for 5.3.16
Static Time: 2.3067169189453 ms
Process exited with code 137.
Output for 5.3.8
Static Time: 2.4166240692139 ms
Process exited with code 137.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/6aiug on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/6aiug on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/6aiug on line 5
Process exited with code 255.