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){ 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; } echo $expr."<br>"; 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.70.0070.00718.53
8.3.60.0120.00918.31
8.3.50.0070.00717.59
8.3.40.0130.00318.51
8.3.30.0130.01018.79
8.3.20.0050.00321.75
8.3.10.0060.00323.36
8.3.00.0080.00023.36
8.2.190.0110.00416.63
8.2.180.0110.01116.57
8.2.170.0140.00722.96
8.2.160.0110.00319.92
8.2.150.0020.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00420.86
8.2.120.0040.00426.35
8.2.110.0030.00719.39
8.2.100.0000.01117.84
8.2.90.0080.00019.23
8.2.80.0000.00818.09
8.2.70.0000.00817.93
8.2.60.0090.00017.75
8.2.50.0040.00418.21
8.2.40.0050.00220.42
8.2.30.0030.00622.49
8.2.20.0050.00218.04
8.2.10.0030.00518.14
8.2.00.0000.00818.06
8.1.280.0040.01125.92
8.1.270.0040.00422.06
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.42
8.1.230.0040.00820.72
8.1.220.0060.00317.75
8.1.210.0060.00318.79
8.1.200.0000.00817.13
8.1.190.0080.00017.00
8.1.180.0040.00418.10
8.1.170.0090.00018.63
8.1.160.0050.00218.95
8.1.150.0000.00720.32
8.1.140.0050.00217.78
8.1.130.0000.00718.98
8.1.120.0000.00717.53
8.1.110.0030.00317.46
8.1.100.0080.00017.47
8.1.90.0070.00317.36
8.1.80.0040.00417.38
8.1.70.0040.00417.52
8.1.60.0050.00517.47
8.1.50.0000.00717.52
8.1.40.0040.00417.50
8.1.30.0090.00017.69
8.1.20.0040.00417.72
8.1.10.0040.00417.66
8.1.00.0060.00317.57
8.0.300.0000.00719.89
8.0.290.0040.00416.75
8.0.280.0040.00418.51
8.0.270.0070.00017.23
8.0.260.0070.00016.75
8.0.250.0060.00316.95
8.0.240.0000.01016.91
8.0.230.0030.00317.02
8.0.220.0040.00416.89
8.0.210.0070.00016.97
8.0.200.0030.00316.87
8.0.190.0000.00716.98
8.0.180.0040.00416.79
8.0.170.0030.00616.84
8.0.160.0020.00516.84
8.0.150.0040.00416.88
8.0.140.0030.00316.82
8.0.130.0000.00613.39
8.0.120.0030.00616.84
8.0.110.0050.00316.91
8.0.100.0000.00716.77
8.0.90.0000.00816.95
8.0.80.0120.00316.86
8.0.70.0040.00416.75
8.0.60.0050.00216.73
8.0.50.0000.00716.93
8.0.30.0110.00717.11
8.0.20.0110.00717.40
8.0.10.0070.00016.91
8.0.00.0120.00816.79
7.4.330.0000.00515.55
7.4.320.0030.00316.54
7.4.300.0030.00316.64
7.4.290.0050.00316.45
7.4.280.0000.00816.53
7.4.270.0000.00716.49
7.4.260.0040.00416.40
7.4.250.0070.00016.43
7.4.240.0000.00716.49
7.4.230.0030.00316.43
7.4.220.0000.00716.52
7.4.210.0020.01216.50
7.4.200.0000.00816.41
7.4.160.0120.00516.49
7.4.140.0110.00817.86
7.4.130.0090.01516.45
7.4.120.0100.00916.50
7.4.110.0070.01016.48
7.4.100.0070.01016.48
7.4.90.0120.00616.60
7.4.80.0030.01919.39
7.4.70.0130.00616.46
7.4.60.0100.00616.44
7.4.50.0060.00616.34
7.4.40.0100.00616.66
7.4.10.0040.01216.32
7.4.00.0090.00915.60
7.3.330.0030.00313.27
7.3.320.0000.00613.17
7.3.310.0070.00016.39
7.3.300.0000.00716.32
7.3.290.0050.00316.30
7.3.280.0070.00816.33
7.3.260.0090.01116.41
7.3.250.0130.00616.52
7.3.240.0110.00816.44
7.3.230.0090.00616.61
7.3.210.0140.00316.63
7.3.200.0000.01516.43
7.3.190.0060.00916.43
7.3.180.0070.01016.52
7.3.170.0080.00816.34
7.3.160.0080.00816.39
7.3.130.0100.00716.30
7.3.120.0100.01015.53
7.3.110.0080.00815.55
7.3.100.0040.01115.69
7.3.90.0070.00515.82
7.3.80.0020.01115.67
7.3.70.0050.00815.58
7.3.60.0000.01415.76
7.3.50.0080.00515.57
7.3.40.0020.01215.54
7.3.30.0070.00715.43
7.3.20.0060.01117.41
7.3.10.0050.00817.23
7.3.00.0050.00817.38
7.2.330.0130.00316.86
7.2.320.0040.01416.82
7.2.310.0070.01516.68
7.2.300.0100.00716.57
7.2.290.0060.00916.77
7.2.260.0090.01216.73
7.2.250.0110.00915.94
7.2.240.0050.01115.88
7.2.230.0060.00815.61
7.2.220.0070.00815.88
7.2.210.0060.00615.89
7.2.200.0110.00515.64
7.2.190.0100.00515.77
7.2.180.0050.00915.60
7.2.170.0020.00715.88
7.2.160.0030.01316.55
7.2.150.0100.00618.58
7.2.140.0030.01018.44
7.2.130.0060.00918.52
7.2.120.0070.01018.46
7.2.110.0030.00718.41
7.2.100.0060.01318.43
7.2.90.0070.01018.18
7.2.80.0070.01018.48
7.2.70.0030.01018.39
7.2.60.0020.01217.72
7.2.50.0070.01118.46
7.2.40.0070.00718.50
7.2.30.0100.01119.06
7.2.20.0090.01118.98
7.2.10.0120.00719.15
7.2.00.0030.01319.07
7.1.330.0050.00816.57
7.1.320.0090.00616.63
7.1.310.0090.00616.61
7.1.300.0040.00816.51
7.1.290.0020.01116.65
7.1.280.0050.00716.67
7.1.270.0110.00316.72
7.1.260.0050.00916.58
7.1.250.0090.00617.32
7.1.240.0030.01217.29
7.1.230.0080.00317.32
7.1.220.0100.00717.32
7.1.210.0000.01517.14
7.1.200.0090.00516.51
7.1.190.0070.00717.32
7.1.180.0070.00717.09
7.1.170.0040.00717.32
7.1.160.0090.00917.42
7.1.150.0050.01117.84
7.1.140.0060.01317.91
7.1.130.0070.00917.95
7.1.120.0030.01317.95
7.1.110.0070.00917.84
7.1.100.0060.01117.73
7.1.90.0060.00717.73
7.1.80.0090.01017.74
7.1.70.0060.01017.43
7.1.60.0170.01126.31
7.1.50.0110.01426.07
7.1.40.0140.01225.76
7.1.30.0130.01425.94
7.1.20.0090.01625.99
7.1.10.0100.00516.97
7.1.00.0080.00916.86
7.0.330.0130.00017.01
7.0.320.0000.01517.11
7.0.310.0060.00316.80
7.0.300.0110.00717.08
7.0.290.0060.00616.96
7.0.280.0070.01116.97
7.0.270.0080.00417.06
7.0.260.0120.00316.97
7.0.250.0030.00616.96
7.0.240.0100.00717.04
7.0.230.0080.00417.16
7.0.220.0030.00617.00
7.0.210.0030.00616.93
7.0.200.0070.01017.12
7.0.190.0090.00316.93
7.0.180.0160.00317.06
7.0.170.0070.00716.96
7.0.160.0060.00317.07
7.0.150.0060.00317.03
7.0.140.0090.00617.00
7.0.130.0120.00317.09
7.0.120.0070.00316.91
7.0.110.0150.00316.87
7.0.100.0030.01016.97
7.0.90.0070.00717.08
7.0.80.0110.00416.97
7.0.70.0070.00317.05
7.0.60.0100.00717.02
7.0.50.0030.01417.03
7.0.40.0040.01015.08
7.0.30.0000.01015.17
7.0.20.0030.01014.86
7.0.10.0090.00615.01
7.0.00.0060.00914.92
5.6.400.0000.01415.81
5.6.390.0030.01315.68
5.6.380.0110.00716.09
5.6.370.0030.01315.95
5.6.360.0030.01416.32
5.6.350.0070.00716.05
5.6.340.0070.01015.65
5.6.330.0030.01216.18
5.6.320.0130.00316.00
5.6.310.0100.00316.08
5.6.300.0120.00315.71
5.6.290.0090.00916.16
5.6.280.0080.00315.78
5.6.270.0120.00615.79
5.6.260.0070.01115.78
5.6.250.0090.00915.89
5.6.240.0100.00715.96
5.6.230.0060.00916.17
5.6.220.0000.01515.80
5.6.210.0120.00815.80
5.6.200.0000.01715.96
5.6.190.0120.00316.02
5.6.180.0080.00315.95
5.6.170.0060.00315.81
5.6.160.0090.00615.92
5.6.150.0060.00615.73
5.6.140.0070.00316.08
5.6.130.0100.00315.80
5.6.120.0070.00716.31
5.6.110.0040.00815.77
5.6.100.0060.00615.85
5.6.90.0040.00816.08
5.6.80.0040.01116.11
5.6.70.0070.00716.18
5.6.60.0100.00315.83
5.6.50.0110.00715.86
5.6.40.0110.00415.72
5.6.30.0090.00615.83
5.6.20.0060.00915.89
5.6.10.0100.00015.82
5.6.00.0100.00015.74

preferences:
59.17 ms | 401 KiB | 5 Q