3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '((\'rats\' + \'stoats\') - 800 / 2)'; $tokens = token_get_all("<?php {$input}"); $expr = ''; foreach($tokens as $token){ print "\ntokens = " . $tokens; if(is_string($token)){ if(in_array($token, array('(', ')', '+', '-', '/', '*'), true)){ $expr .= $token; print "\n symbol: " . $expr; } continue; } list($id, $text) = $token; if(in_array($id, array(T_DNUMBER, T_LNUMBER,T_CONSTANT_ENCAPSED_STRING))){ $expr .= $text; print "\n number: " . $expr; } } 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.0070.00716.50
8.3.50.0070.01317.45
8.3.40.0070.01018.83
8.3.30.0090.00618.84
8.3.20.0050.00318.69
8.3.10.0080.00020.44
8.3.00.0030.00517.71
8.2.180.0110.01116.50
8.2.170.0070.00722.96
8.2.160.0120.00322.06
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.87
8.2.110.0090.00021.10
8.2.100.0090.00317.84
8.2.90.0040.00419.26
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0030.00518.16
8.2.50.0000.00818.07
8.2.40.0040.00419.89
8.2.30.0040.00418.11
8.2.20.0070.00017.82
8.2.10.0080.00317.71
8.2.00.0080.00017.88
8.1.280.0070.01525.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.64
8.1.230.0120.00020.88
8.1.220.0050.00318.77
8.1.210.0040.00418.97
8.1.200.0030.00617.35
8.1.190.0040.00417.53
8.1.180.0090.00018.10
8.1.170.0000.00818.89
8.1.160.0040.00418.97
8.1.150.0000.00718.63
8.1.140.0040.00417.45
8.1.130.0040.00417.86
8.1.120.0050.00317.49
8.1.110.0040.00417.38
8.1.100.0020.00517.49
8.1.90.0000.00817.38
8.1.80.0040.00417.48
8.1.70.0090.00017.38
8.1.60.0000.00817.68
8.1.50.0000.00717.39
8.1.40.0040.00417.55
8.1.30.0040.00417.51
8.1.20.0080.00017.58
8.1.10.0040.00417.64
8.1.00.0030.00617.57
8.0.300.0080.00020.20
8.0.290.0000.00816.75
8.0.280.0000.00718.47
8.0.270.0030.00317.30
8.0.260.0030.00316.79
8.0.250.0000.00716.95
8.0.240.0060.00616.96
8.0.230.0070.00016.95
8.0.220.0070.00016.98
8.0.210.0030.00316.98
8.0.200.0040.00417.09
8.0.190.0000.00817.11
8.0.180.0050.00316.94
8.0.170.0040.00417.01
8.0.160.0000.00816.87
8.0.150.0000.00816.83
8.0.140.0080.00016.85
8.0.130.0050.00013.36
8.0.120.0040.00416.89
8.0.110.0030.00517.03
8.0.100.0000.00716.86
8.0.90.0070.00016.79
8.0.80.0090.00617.01
8.0.70.0030.00516.82
8.0.60.0070.00017.04
8.0.50.0000.00816.79
8.0.30.0070.01717.01
8.0.20.0090.01417.16
8.0.10.0040.00417.02
8.0.00.0110.01016.66
7.4.330.0020.00213.00
7.4.320.0030.00316.65
7.4.300.0000.00616.48
7.4.290.0000.00816.61
7.4.280.0030.00816.53
7.4.270.0050.00216.56
7.4.260.0030.00313.23
7.4.250.0050.00516.60
7.4.240.0050.00216.59
7.4.230.0040.00416.43
7.4.220.0030.01816.49
7.4.210.0050.00916.57
7.4.200.0040.00416.56
7.4.190.0050.00316.71
7.4.160.0100.01016.64
7.4.150.0070.01116.55
7.4.140.0130.00616.55
7.4.130.0100.00916.48
7.4.120.0050.01516.51
7.4.110.0080.01116.47
7.4.100.0040.01316.53
7.4.90.0140.00316.73
7.4.80.0150.00416.39
7.4.70.0060.01316.63
7.4.60.0120.00916.52
7.4.50.0030.00516.68
7.4.40.0060.00316.59
7.4.30.0130.00316.48
7.4.00.0090.00615.05
7.3.330.0000.00613.27
7.3.320.0060.00013.25
7.3.310.0000.00716.28
7.3.300.0070.00016.40
7.3.290.0110.00316.36
7.3.280.0110.00716.41
7.3.270.0070.01116.57
7.3.260.0100.00916.60
7.3.250.0090.01016.40
7.3.240.0070.01416.42
7.3.230.0130.00516.51
7.3.210.0110.00716.46
7.3.200.0100.00719.39
7.3.190.0090.01316.37
7.3.180.0100.00716.59
7.3.170.0070.01116.47
7.3.160.0100.00716.63
7.3.120.0090.00614.87
7.2.330.0130.00516.73
7.2.320.0070.01116.87
7.2.310.0130.01016.60
7.2.300.0090.00916.69
7.2.290.0080.00916.58
7.2.60.0100.00317.05
7.2.00.0040.01519.23
7.1.200.0040.00815.82
7.1.100.0080.00418.02
7.1.70.0040.00417.28
7.1.60.0140.01019.40
7.1.50.0030.01717.06
7.1.00.0000.06022.32
7.0.200.0030.00616.79
7.0.140.0030.06722.05
7.0.120.0070.08022.08
7.0.60.0070.04020.04
7.0.50.0030.05017.84
7.0.40.0130.08020.30
7.0.30.0130.04320.21
7.0.20.0270.06720.21
7.0.10.0130.04720.12
7.0.00.0030.08319.99
5.6.280.0070.07020.79
5.6.210.0030.08720.56
5.6.200.0030.09318.19
5.6.190.0100.03720.76
5.6.180.0170.04720.47
5.6.170.0200.04320.34
5.6.160.0100.03320.49
5.6.150.0100.03318.08
5.6.140.0070.03718.12
5.6.130.0070.08718.08
5.6.120.0130.04720.99
5.6.110.0030.04021.11
5.6.100.0070.04321.00
5.6.90.0070.07721.10
5.6.80.0170.05720.40
5.6.70.4370.03320.49
5.5.350.0330.07320.38
5.5.340.0100.07317.91
5.5.330.0030.05320.43
5.5.320.0330.04720.15
5.5.310.0200.03720.12
5.5.300.0030.04717.89
5.5.290.0030.05017.88
5.5.280.0100.05020.80
5.5.270.0000.05020.68
5.5.260.0000.04320.76
5.5.250.0130.08020.66
5.5.240.0170.04720.26
5.4.450.0070.07719.45
5.4.440.0030.06019.47
5.4.430.0030.07019.32
5.4.420.0030.05019.24
5.4.410.0130.06319.27
5.4.400.0030.04319.15
5.4.390.0100.06719.18
5.4.380.0100.03319.18
5.4.370.0130.07018.82
5.4.360.0030.08719.00
5.4.350.0100.05719.14
5.4.340.0070.05019.14
5.4.320.0100.07319.12
5.4.310.0030.04719.14
5.4.300.0100.04319.09
5.4.290.0130.05019.17
5.4.280.0070.07718.79
5.4.270.0030.05019.17
5.4.260.0030.08019.18
5.4.250.0070.07719.08
5.4.240.0070.08318.78
5.4.230.0130.05318.80
5.4.220.0070.07018.80
5.4.210.0130.07018.87
5.4.200.0070.05019.07
5.4.190.0000.08019.17
5.4.180.0130.07019.13
5.4.170.0000.08719.07
5.4.160.0100.07019.05
5.4.150.0170.03019.15
5.4.140.0070.07316.16
5.4.130.0030.04716.35
5.4.120.0070.04316.25
5.4.110.0000.04716.37
5.4.100.0070.07316.26
5.4.90.0130.04716.60
5.4.80.0130.06316.27
5.4.70.0030.03716.22
5.4.60.0030.06016.24
5.4.50.0000.04016.21
5.4.40.0070.06016.34
5.4.30.0070.07016.13
5.4.20.0100.05016.31
5.4.10.0070.07016.36
5.4.00.0000.03715.64
5.3.290.0030.04714.62
5.3.280.0030.05014.53
5.3.270.0170.04314.44
5.3.260.0030.07714.57
5.3.250.0030.04714.56
5.3.240.0000.04014.55
5.3.230.0070.05014.57
5.3.220.0000.08014.46
5.3.210.0100.03714.50
5.3.200.0030.03714.59
5.3.190.0100.03314.48
5.3.180.0130.06714.50
5.3.170.0000.04714.39
5.3.160.0130.02714.55
5.3.150.0030.05014.36
5.3.140.0030.07714.66
5.3.130.0030.04314.49
5.3.120.0000.04014.50
5.3.110.0100.07014.49
5.3.100.0070.04714.01
5.3.90.0030.06313.86
5.3.80.0030.05714.13
5.3.70.0030.04014.12
5.3.60.0070.05713.96
5.3.50.0030.04313.95
5.3.40.0100.07713.86
5.3.30.0030.07013.89
5.3.20.0030.04713.63
5.3.10.0070.03713.63
5.3.00.0070.06013.47
5.2.170.0000.04011.32
5.2.160.0030.03311.16
5.2.150.0100.04011.02
5.2.140.0000.04311.07
5.2.130.0000.03711.05
5.2.120.0170.04711.07
5.2.110.0030.05711.06
5.2.100.0130.05311.11
5.2.90.0030.06311.28
5.2.80.0100.04310.94
5.2.70.0000.07011.20
5.2.60.0070.03710.93
5.2.50.0070.06010.93
5.2.40.0100.05710.98
5.2.30.0100.03710.88
5.2.20.0070.03010.93
5.2.10.0030.05310.91
5.2.00.0030.03310.77
5.1.60.0030.0539.92
5.1.50.0130.02010.01
5.1.40.0070.04010.15
5.1.30.0030.06010.49
5.1.20.0070.03010.38
5.1.10.0000.02710.00
5.1.00.0000.03010.15
5.0.50.0030.0278.47
5.0.40.0030.0178.40
5.0.30.0030.0678.29
5.0.20.0030.0438.26
5.0.10.0030.0438.21
5.0.00.0000.0708.23
4.4.90.0030.0277.95
4.4.80.0030.0377.95
4.4.70.0000.0407.95
4.4.60.0030.0337.95
4.4.50.0000.0237.95
4.4.40.0000.0277.95
4.4.30.0030.0337.95
4.4.20.0030.0277.95
4.4.10.0000.0207.95
4.4.00.0030.0237.95
4.3.110.0070.0137.95
4.3.100.0000.0277.95
4.3.90.0070.0277.95
4.3.80.0000.0507.95
4.3.70.0000.0177.95
4.3.60.0000.0377.95
4.3.50.0030.0277.95
4.3.40.0030.0507.95
4.3.30.0030.0337.95
4.3.20.0030.0377.95
4.3.10.0030.0137.95
4.3.00.0000.0237.95

preferences:
33.84 ms | 401 KiB | 5 Q