3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var; function connectToDB($string) { return false } switch (false) { // check if we have DB credentials. case isset($DBcredentials): $DBcredentials = 'myawesomepassword';; echo "Setting var" . PHP_EOL; // connect to DB. case connectToDB($DBcredentials): // delberiate fall through, case $var is *not* caught, but we end here anyways. $var = 1; echo "Truthing Var" . PHP_EOL; case is_string($var): // delebirate fall through, case is_string($var) is *not* caught, but we end here anyways. $var = (string) $var; echo "Stringing var" . PHP_EOL; break; /* case customGuardFunction() */ default: echo "All checks passed!"; } var_dump($var);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0020.01616.71
7.1.60.0230.01734.97
7.1.50.0190.01334.41
7.1.40.0270.01434.33
7.1.30.0250.01634.38
7.1.20.0250.01634.39
7.1.10.0060.01316.39
7.1.00.0240.01316.32
7.0.200.0090.00616.64
7.0.190.0060.01316.39
7.0.180.0100.01116.12
7.0.170.0050.01416.00
7.0.160.0040.01716.21
7.0.150.0060.01416.13
7.0.140.0050.01516.05
7.0.130.0080.01316.34
7.0.120.0100.01116.25
7.0.110.0070.01316.17
7.0.100.0060.01315.87
7.0.90.0090.00916.23
7.0.80.0100.01116.23
7.0.70.0190.00016.23
7.0.60.0130.01115.70
7.0.50.0110.01216.36
7.0.40.0060.01416.28
7.0.30.0020.01616.28
7.0.20.0140.00516.29
7.0.10.0030.01716.02
7.0.00.0030.01516.14

preferences:
137.66 ms | 1394 KiB | 7 Q