3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '$x=100; ((800 + 20) - 800 / 2)'; $tokens = token_get_all("<?php {$input}"); $expr = ''; foreach($tokens as $token){ echo $token."<br>"; if(is_string($token)){ if(in_array($token, array('(', ')', '+', '-', '/', '*','if','IF' , '{' ,'}' , ';' ,'$'), true)) $expr .= $token; continue; } list($id, $text) = $token; if(in_array($id, array(T_DNUMBER, T_LNUMBER))) $expr .= $text; } eval("\$result = {$expr};"); print "\nexpr = " . $expr; print "\nres = " . $result;

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)
8.3.60.0110.00718.43
8.3.50.0000.01417.95
8.3.40.0060.01218.92
8.3.30.0100.00718.63
8.3.20.0040.00421.76
8.3.10.0000.00723.64
8.3.00.0000.00823.66
8.2.180.0160.00616.82
8.2.170.0150.00022.96
8.2.160.0040.01120.10
8.2.150.0020.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00421.12
8.2.120.0000.00726.35
8.2.110.0100.01321.10
8.2.100.0120.00019.63
8.2.90.0000.00818.15
8.2.80.0000.00817.97
8.2.70.0040.00418.03
8.2.60.0060.00318.16
8.2.50.0000.00818.10
8.2.40.0040.00420.62
8.2.30.0000.00820.70
8.2.20.0020.00518.20
8.2.10.0000.00718.04
8.2.00.0070.00018.02
8.1.280.0060.00925.92
8.1.270.0000.00722.10
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00319.27
8.1.230.0080.00422.63
8.1.220.0080.00017.79
8.1.210.0060.00318.90
8.1.200.0040.00417.22
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0040.00418.61
8.1.160.0000.00718.87
8.1.150.0070.00020.19
8.1.140.0070.00017.64
8.1.130.0070.00017.51
8.1.120.0000.00717.37
8.1.110.0040.00417.38
8.1.100.0040.00417.49
8.1.90.0060.00317.44
8.1.80.0000.00817.36
8.1.70.0040.00417.43
8.1.60.0040.00417.61
8.1.50.0060.00317.57
8.1.40.0040.00417.50
8.1.30.0000.00817.66
8.1.20.0000.00817.60
8.1.10.0040.00417.52
8.1.00.0000.00817.53
8.0.300.0000.00719.66
8.0.290.0040.00416.75
8.0.280.0050.00318.37
8.0.270.0080.00017.31
8.0.260.0050.00316.80
8.0.250.0000.01116.99
8.0.240.0070.00316.93
8.0.230.0040.00417.05
8.0.220.0000.00716.96
8.0.210.0000.00716.83
8.0.200.0080.00017.09
8.0.190.0020.00516.95
8.0.180.0060.00317.04
8.0.170.0030.00616.99
8.0.160.0040.00416.96
8.0.150.0000.00716.75
8.0.140.0030.00316.93
8.0.130.0000.00513.43
8.0.120.0080.00016.92
8.0.110.0000.00817.00
8.0.100.0000.00717.03
8.0.90.0000.00816.87
8.0.80.0070.00716.96
8.0.70.0000.00717.09
8.0.60.0050.00316.87
8.0.50.0040.00416.93
8.0.30.0140.00517.16
8.0.20.0090.01117.40
8.0.10.0040.00417.10
8.0.00.0100.01316.92
7.4.330.0000.00515.55
7.4.320.0040.00416.53
7.4.300.0030.00316.63
7.4.290.0070.00016.50
7.4.280.0040.00416.66
7.4.270.0020.00516.51
7.4.260.0030.00316.49
7.4.250.0000.00716.34
7.4.240.0040.00416.45
7.4.230.0080.00016.36
7.4.220.0000.00816.59
7.4.210.0090.01216.42
7.4.200.0030.00416.58
7.4.160.0100.00816.52
7.4.140.0080.01117.86
7.4.130.0110.00616.44
7.4.120.0110.00816.49
7.4.110.0120.00616.61
7.4.100.0060.01216.43
7.4.90.0110.01116.48
7.4.80.0140.01019.39
7.4.70.0140.00616.45
7.4.60.0130.00316.43
7.4.50.0040.01416.41
7.4.40.0130.00716.39
7.4.00.0080.01014.94
7.3.330.0050.00013.31
7.3.320.0030.00313.23
7.3.310.0030.00316.44
7.3.300.0040.00316.25
7.3.290.0100.00416.38
7.3.280.0100.00916.36
7.3.260.0120.00816.38
7.3.250.0100.00816.36
7.3.240.0080.01116.49
7.3.230.0030.01316.38
7.3.210.0070.01016.47
7.3.200.0160.00016.57
7.3.190.0100.00616.66
7.3.180.0060.01216.64
7.3.170.0070.01116.41
7.3.160.0090.00916.43
7.3.120.0090.00614.89
7.3.110.0030.01315.03
7.3.100.0060.00614.78
7.3.90.0140.00014.98
7.3.80.0070.00714.65
7.3.70.0070.00714.75
7.3.60.0050.00514.92
7.3.50.0090.00614.84
7.3.40.0060.01015.03
7.3.30.0120.00314.91
7.3.20.0030.01316.70
7.3.10.0080.00516.65
7.3.00.0080.00516.70
7.2.330.0030.01716.64
7.2.320.0120.01216.75
7.2.310.0100.00716.41
7.2.300.0100.00716.75
7.2.290.0110.00716.80
7.2.250.0070.01015.32
7.2.240.0030.01614.93
7.2.230.0120.00614.97
7.2.220.0140.00014.88
7.2.210.0100.00714.98
7.2.200.0070.00715.04
7.2.190.0070.00415.10
7.2.180.0100.00014.77
7.2.170.0060.00315.17
7.2.130.0070.01016.89
7.2.120.0090.00616.77
7.2.110.0100.00717.02
7.2.100.0090.00616.82
7.2.90.0100.00716.73
7.2.80.0070.01117.01
7.2.70.0060.00617.16
7.2.60.0030.01217.04
7.2.50.0080.00817.12
7.2.40.0000.01717.16
7.2.30.0070.01018.54
7.2.20.0140.00718.44
7.2.10.0100.01018.57
7.2.00.0070.01318.27
7.1.330.0100.00315.51
7.1.320.0120.00415.93
7.1.310.0000.01416.11
7.1.300.0040.01115.93
7.1.290.0000.01315.83
7.1.280.0060.01015.66
7.1.270.0090.00015.75
7.1.260.0030.01015.88
7.1.250.0080.00415.88
7.1.200.0070.00715.80
7.1.150.0090.01218.95
7.1.140.0090.01418.56
7.1.130.0080.01118.60
7.1.120.0130.01118.41
7.1.110.0060.01118.00
7.1.100.0050.01518.18
7.1.90.0060.01317.84
7.1.80.0090.01218.36
7.1.70.0080.01417.34
7.1.60.0260.01834.91
7.1.50.0300.01534.88
7.1.40.0260.01834.34
7.1.30.0320.01934.41
7.1.20.0290.01334.57
7.1.10.0090.01216.33
7.1.00.0100.00916.87

preferences:
67.42 ms | 401 KiB | 5 Q