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 $tokens."<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.0140.00418.55
8.3.50.0140.00018.29
8.3.40.0070.01418.76
8.3.30.0190.00418.87
8.3.20.0080.00021.90
8.3.10.0070.00023.66
8.3.00.0050.00323.66
8.2.180.0130.01016.75
8.2.170.0070.01522.96
8.2.160.0040.01119.91
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00021.06
8.2.120.0070.00026.35
8.2.110.0000.00922.20
8.2.100.0090.00317.97
8.2.90.0040.00419.34
8.2.80.0050.00318.16
8.2.70.0080.00018.02
8.2.60.0090.00017.49
8.2.50.0000.00818.22
8.2.40.0040.00420.50
8.2.30.0070.00020.55
8.2.20.0040.00418.05
8.2.10.0030.00618.04
8.2.00.0040.00418.14
8.1.280.0120.00325.92
8.1.270.0080.00022.13
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0090.00023.87
8.1.230.0110.00420.97
8.1.220.0030.00617.74
8.1.210.0030.00718.77
8.1.200.0040.00417.25
8.1.190.0080.00017.00
8.1.180.0030.00618.10
8.1.170.0030.00618.50
8.1.160.0000.00718.85
8.1.150.0040.00420.23
8.1.140.0040.00417.61
8.1.130.0050.00318.96
8.1.120.0040.00417.36
8.1.110.0000.00817.46
8.1.100.0070.00017.35
8.1.90.0070.00317.44
8.1.80.0000.00717.44
8.1.70.0040.00417.38
8.1.60.0000.00917.48
8.1.50.0040.00417.36
8.1.40.0050.00217.49
8.1.30.0060.00317.62
8.1.20.0040.00417.50
8.1.10.0040.00417.59
8.1.00.0050.00317.54
8.0.300.0050.00319.97
8.0.290.0040.00416.63
8.0.280.0040.00418.42
8.0.270.0030.00317.27
8.0.260.0040.00416.88
8.0.250.0050.00517.03
8.0.240.0000.00917.00
8.0.230.0000.00716.92
8.0.220.0050.00316.96
8.0.210.0070.00017.01
8.0.200.0050.00316.90
8.0.190.0020.00517.00
8.0.180.0040.00417.00
8.0.170.0060.00316.91
8.0.160.0000.00717.05
8.0.150.0030.00616.81
8.0.140.0020.00516.83
8.0.130.0030.00313.44
8.0.120.0050.00216.94
8.0.110.0000.00717.00
8.0.100.0000.00717.01
8.0.90.0000.00716.77
8.0.80.0070.00716.93
8.0.70.0030.00517.08
8.0.60.0050.00316.96
8.0.50.0000.00716.86
8.0.30.0110.01117.08
8.0.20.0050.01417.40
8.0.10.0050.00316.98
8.0.00.0140.00816.79
7.4.330.0000.00615.55
7.4.320.0000.00916.43
7.4.300.0060.00016.50
7.4.290.0080.00016.61
7.4.280.0050.00316.52
7.4.270.0000.00716.63
7.4.260.0030.00316.40
7.4.250.0040.00416.50
7.4.240.0050.00316.55
7.4.230.0040.00416.33
7.4.220.0030.00516.54
7.4.210.0050.01016.59
7.4.200.0000.00716.73
7.4.160.0090.00816.52
7.4.140.0120.00817.86
7.4.130.0090.00816.70
7.4.120.0110.00916.58
7.4.110.0070.01016.45
7.4.100.0150.00316.66
7.4.90.0070.01116.39
7.4.80.0090.01219.39
7.4.70.0120.00916.56
7.4.60.0100.00716.63
7.4.50.0080.00316.57
7.4.40.0030.01616.43
7.4.10.0070.01316.59
7.4.00.0050.01115.74
7.3.330.0000.00613.33
7.3.320.0000.00613.27
7.3.310.0030.00316.40
7.3.300.0000.00716.44
7.3.290.0030.00316.26
7.3.280.0070.01016.39
7.3.260.0090.00916.34
7.3.250.0080.00916.46
7.3.240.0100.01016.46
7.3.230.0070.00916.35
7.3.210.0090.00916.49
7.3.200.0120.00916.61
7.3.190.0130.00316.63
7.3.180.0170.00716.60
7.3.170.0060.01116.60
7.3.160.0070.01016.59
7.3.130.0050.01316.37
7.3.120.0090.00616.45
7.3.110.0080.00516.34
7.3.100.0040.01416.57
7.3.90.0030.01016.42
7.3.80.0030.01016.46
7.3.70.0070.01316.43
7.3.60.0070.00716.49
7.3.50.0070.01016.38
7.3.40.0060.00916.34
7.3.30.0000.00916.37
7.3.20.0080.00518.21
7.3.10.0040.00917.36
7.3.00.0060.01017.28
7.2.330.0150.00316.43
7.2.320.0090.01416.59
7.2.310.0130.00616.75
7.2.300.0060.01116.47
7.2.290.0060.01016.71
7.2.260.0040.01816.35
7.2.250.0100.01016.76
7.2.240.0070.01016.50
7.2.230.0060.01016.66
7.2.220.0070.00716.47
7.2.210.0080.01116.51
7.2.200.0000.01216.71
7.2.190.0090.00616.33
7.2.180.0030.00916.64
7.2.170.0070.00416.54
7.2.160.0030.01016.42
7.2.150.0070.00718.38
7.2.140.0070.01318.32
7.2.130.0070.01017.41
7.2.120.0030.01117.62
7.2.110.0090.00817.37
7.2.100.0050.01217.61
7.2.90.0080.00817.57
7.2.80.0070.01017.51
7.2.70.0060.00617.42
7.2.60.0080.00617.06
7.2.50.0030.01017.59
7.2.40.0140.00217.46
7.2.30.0080.00718.35
7.2.20.0090.00918.23
7.2.10.0070.01018.33
7.2.00.0110.00918.32
7.1.330.0090.00617.21
7.1.320.0060.00617.58
7.1.310.0070.01417.26
7.1.300.0040.01117.41
7.1.290.0070.01017.43
7.1.280.0060.00317.36
7.1.270.0040.01217.28
7.1.260.0090.00917.46
7.1.250.0030.01116.45
7.1.240.0080.00817.54
7.1.230.0090.00617.14
7.1.220.0100.00317.29
7.1.210.0060.00917.40
7.1.200.0030.01016.38
7.1.190.0000.00917.34
7.1.180.0030.00917.36
7.1.170.0040.01117.31
7.1.160.0070.00417.38
7.1.150.0050.01017.95
7.1.140.0090.00718.08
7.1.130.0060.01317.98
7.1.120.0110.01017.98
7.1.110.0090.00817.80
7.1.100.0090.00817.74
7.1.90.0060.01117.87
7.1.80.0040.01017.81
7.1.70.0040.01417.32
7.1.60.0170.00926.28
7.1.50.0220.01226.01
7.1.40.0140.01025.87
7.1.30.0170.01425.96
7.1.20.0150.01325.88
7.1.10.0050.01317.08
7.1.00.0070.00917.04
7.0.330.0060.00617.19
7.0.320.0120.00316.89
7.0.310.0040.01416.99
7.0.300.0090.00317.02
7.0.290.0070.00416.96
7.0.280.0060.00617.09
7.0.270.0070.00717.01
7.0.260.0070.01116.99
7.0.250.0000.01216.88
7.0.240.0000.01417.10
7.0.230.0060.01017.14
7.0.220.0070.00416.94
7.0.210.0090.00016.83
7.0.200.0060.00917.13
7.0.190.0030.01017.22
7.0.180.0040.00817.04
7.0.170.0030.00717.07
7.0.160.0060.00317.10
7.0.150.0070.00316.95
7.0.140.0030.01016.95
7.0.130.0030.00816.99
7.0.120.0060.00916.96
7.0.110.0130.00317.07
7.0.100.0090.00617.04
7.0.90.0040.01117.08
7.0.80.0090.00317.09
7.0.70.0030.01017.07
7.0.60.0060.00617.00
7.0.50.0100.00316.92
7.0.40.0100.00715.11
7.0.30.0090.00614.99
7.0.20.0110.00414.97
7.0.10.0100.00014.91
7.0.00.0100.00715.03
5.6.400.0070.01116.00
5.6.390.0060.00616.00
5.6.380.0030.00715.80
5.6.370.0040.01116.07
5.6.360.0000.01015.68
5.6.350.0030.01215.83
5.6.340.0030.00916.08
5.6.330.0100.01015.83
5.6.320.0040.01216.00
5.6.310.0030.01015.98
5.6.300.0070.01116.14
5.6.290.0000.00916.21
5.6.280.0120.00616.13
5.6.270.0120.00615.98
5.6.260.0030.01315.98
5.6.250.0060.00915.97
5.6.240.0000.01615.74
5.6.230.0070.00715.90
5.6.220.0030.00916.19
5.6.210.0030.01316.00
5.6.200.0070.00415.81
5.6.190.0060.00615.90
5.6.180.0060.00615.89
5.6.170.0030.01016.00
5.6.160.0100.00716.14
5.6.150.0150.00015.92
5.6.140.0100.00715.91
5.6.130.0080.00816.00
5.6.120.0030.01715.71
5.6.110.0100.01015.66
5.6.100.0030.01015.93
5.6.90.0120.00415.83
5.6.80.0040.01215.89
5.6.70.0070.00715.95
5.6.60.0060.00915.87
5.6.50.0000.01416.05
5.6.40.0030.01315.91
5.6.30.0070.01015.80
5.6.20.0060.00816.03
5.6.10.0070.00715.95
5.6.00.0000.00915.88

preferences:
69.14 ms | 401 KiB | 5 Q