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 = " . $token; 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.0120.00316.74
8.3.50.0110.01017.57
8.3.40.0070.00718.84
8.3.30.0140.00018.79
8.3.20.0030.00518.77
8.3.10.0030.00620.70
8.3.00.0030.00617.48
8.2.180.0040.01216.63
8.2.170.0070.01422.96
8.2.160.0100.01021.96
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.76
8.2.110.0070.00320.89
8.2.100.0090.00317.83
8.2.90.0030.00719.34
8.2.80.0040.00417.93
8.2.70.0040.00417.75
8.2.60.0040.00418.05
8.2.50.0060.00318.07
8.2.40.0080.00019.88
8.2.30.0030.00518.19
8.2.20.0000.00817.69
8.2.10.0050.00217.89
8.2.00.0040.00417.75
8.1.280.0030.01325.92
8.1.270.0050.00324.66
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00320.87
8.1.230.0000.01120.88
8.1.220.0000.00817.80
8.1.210.0040.00419.04
8.1.200.0030.00717.35
8.1.190.0000.00817.54
8.1.180.0030.00518.10
8.1.170.0070.00018.84
8.1.160.0040.00418.86
8.1.150.0060.00618.60
8.1.140.0060.00317.39
8.1.130.0030.00317.89
8.1.120.0030.00517.54
8.1.110.0000.00817.50
8.1.100.0040.00417.45
8.1.90.0040.00417.40
8.1.80.0000.00717.41
8.1.70.0040.00417.49
8.1.60.0000.00817.62
8.1.50.0040.00417.54
8.1.40.0040.00417.56
8.1.30.0020.00517.68
8.1.20.0000.00917.62
8.1.10.0030.00617.55
8.1.00.0040.00417.47
8.0.300.0030.00519.82
8.0.290.0000.00716.88
8.0.280.0030.00518.52
8.0.270.0030.00517.30
8.0.260.0030.00316.91
8.0.250.0070.00016.97
8.0.240.0060.00317.02
8.0.230.0030.00317.01
8.0.220.0000.00617.04
8.0.210.0000.00716.92
8.0.200.0070.00016.95
8.0.190.0040.00417.02
8.0.180.0080.00016.91
8.0.170.0080.00016.90
8.0.160.0070.00017.10
8.0.150.0050.00316.82
8.0.140.0030.00516.95
8.0.130.0030.00313.38
8.0.120.0050.00316.92
8.0.110.0040.00416.88
8.0.100.0020.00517.06
8.0.90.0050.00217.06
8.0.80.0060.00916.98
8.0.70.0070.00016.87
8.0.60.0040.00417.05
8.0.50.0050.00316.82
8.0.30.0090.01017.06
8.0.20.0110.00717.26
8.0.10.0020.00517.16
8.0.00.0100.00816.95
7.4.330.0020.00214.76
7.4.320.0060.00016.54
7.4.300.0000.00616.53
7.4.290.0000.00716.65
7.4.280.0030.00616.64
7.4.270.0000.00716.61
7.4.260.0030.00313.34
7.4.250.0050.00316.42
7.4.240.0010.00616.55
7.4.230.0030.00316.47
7.4.220.0130.00316.64
7.4.210.0070.01216.69
7.4.200.0050.00316.71
7.4.190.0000.00816.46
7.4.160.0130.00316.44
7.4.150.0070.01117.07
7.4.140.0150.00517.23
7.4.130.0080.01016.69
7.4.120.0070.01316.59
7.4.110.0110.00616.54
7.4.100.0130.01016.52
7.4.90.0110.00716.72
7.4.80.0070.01018.63
7.4.70.0100.00716.51
7.4.60.0030.01316.64
7.4.50.0050.00020.09
7.4.40.0100.00721.69
7.4.30.0100.00716.68
7.4.00.0040.01414.96
7.3.330.0000.00613.30
7.3.320.0000.00613.29
7.3.310.0070.00016.35
7.3.300.0070.00016.40
7.3.290.0060.01416.57
7.3.280.0100.00616.45
7.3.270.0070.01417.07
7.3.260.0080.00818.24
7.3.250.0180.01216.60
7.3.240.0070.01016.52
7.3.230.0110.00816.46
7.3.210.0120.00416.51
7.3.200.0110.01219.39
7.3.190.0180.00616.48
7.3.180.0080.00816.36
7.3.170.0140.00316.42
7.3.160.0120.00416.42
7.3.120.0030.00815.10
7.2.330.0120.00916.86
7.2.320.0090.01016.75
7.2.310.0000.02316.47
7.2.300.0160.01016.79
7.2.290.0090.00916.49
7.2.80.0060.01016.82
7.2.60.0100.00316.91
7.1.200.0030.01015.80
7.1.100.0060.00618.23
7.1.70.0060.00316.98
7.1.60.0120.01219.40
7.1.50.0060.00916.99
7.1.00.0030.07722.39
7.0.200.0040.00416.87
7.0.140.0030.07022.12
7.0.120.0000.03322.12
7.0.60.0030.04019.83
7.0.50.0000.04717.92
7.0.40.0030.09020.36
7.0.30.0300.04320.30
7.0.20.0300.07720.09
7.0.10.0170.05020.00
7.0.00.0100.08720.19
5.6.280.0000.07320.91
5.6.210.0100.07720.70
5.6.200.0100.05718.13
5.6.190.0030.08320.39
5.6.180.0200.08020.41
5.6.170.0270.05320.52
5.6.160.0000.05320.47
5.6.150.0100.04318.15
5.6.140.0070.07718.19
5.6.130.0130.08018.14
5.6.120.0130.06721.00
5.6.110.0100.08321.04
5.6.100.0130.07721.04
5.6.90.0130.08720.97
5.6.80.0030.04720.40
5.5.350.0170.05020.38
5.5.340.0070.04017.89
5.5.330.0030.05020.37
5.5.320.0070.04020.23
5.5.310.0400.06320.29
5.5.300.0000.06018.02
5.5.290.0000.06717.98
5.5.280.0000.09020.82
5.5.270.0030.04320.77
5.5.260.0030.05720.73
5.5.250.0030.08320.71
5.5.240.0070.08320.27
5.4.450.0070.03319.51
5.4.440.0000.04319.11
5.4.430.0070.03319.41
5.4.420.0030.05019.24
5.4.410.0070.03319.34
5.4.400.0030.04718.81
5.4.390.0070.08018.82
5.4.380.0100.03719.20
5.4.370.0000.08318.93
5.4.360.0130.04319.14
5.4.350.0030.07019.18
5.4.340.0070.07718.79
5.4.320.0070.07319.18
5.4.310.0030.07719.14
5.4.300.0100.05018.92
5.4.290.0130.07018.78
5.4.280.0000.08719.16
5.4.270.0000.04018.94
5.4.260.0070.06319.15
5.4.250.0030.06019.13
5.4.240.0130.06019.11
5.4.230.0170.03719.14
5.4.220.0000.07318.79
5.4.210.0070.04719.14
5.4.200.0030.07319.14
5.4.190.0170.06718.78
5.4.180.0070.06019.07
5.4.170.0030.08019.07
5.4.160.0170.06018.90
5.4.150.0030.07018.77
5.4.140.0100.07016.36
5.4.130.0000.05316.39
5.4.120.0130.06316.43
5.4.110.0100.06316.32
5.4.100.0000.05316.41
5.4.90.0170.06716.41
5.4.80.0100.07316.36
5.4.70.0070.04016.29
5.4.60.0070.07716.34
5.4.50.0170.05016.34
5.4.40.0030.04016.32
5.4.30.0070.06316.35
5.4.20.0070.07016.57
5.4.10.0030.06716.34
5.4.00.0100.07315.73
5.3.290.0070.08014.64
5.3.280.0030.06714.48
5.3.270.0100.07014.50
5.3.260.0100.07314.55
5.3.250.0100.06714.64
5.3.240.0130.07014.55
5.3.230.0070.08014.53
5.3.220.0100.06714.51
5.3.210.0130.04314.40
5.3.200.0070.07714.62
5.3.190.0000.04314.55
5.3.180.0100.03314.51
5.3.170.0070.07014.50
5.3.160.0070.06714.51
5.3.150.0100.07314.52
5.3.140.0170.06314.68
5.3.130.0070.07714.50
5.3.120.0000.08014.55
5.3.110.0000.08714.35
5.3.100.0070.07714.02
5.3.90.0100.04013.97
5.3.80.0030.05314.01
5.3.70.0130.03713.85
5.3.60.0100.07013.96
5.3.50.0000.08013.98
5.3.40.0130.06313.89
5.3.30.0070.06714.03
5.3.20.0070.04013.50
5.3.10.0030.03713.59
5.3.00.0100.07313.47
5.2.170.0100.06711.19
5.2.160.0030.04011.17
5.2.150.0070.06011.07
5.2.140.0030.03711.09
5.2.130.0030.05710.98
5.2.120.0000.04011.20
5.2.110.0000.05711.03
5.2.100.0070.05011.03
5.2.90.0070.06311.13
5.2.80.0030.06311.04
5.2.70.0030.05010.98
5.2.60.0070.03311.00
5.2.50.0070.05710.93
5.2.40.0070.05711.00
5.2.30.0070.06011.07
5.2.20.0100.04710.84
5.2.10.0070.05710.79
5.2.00.0070.04010.79
5.1.60.0000.0309.98
5.1.50.0000.0309.92
5.1.40.0030.0579.98
5.1.30.0000.06010.34
5.1.20.0100.04710.38
5.1.10.0030.03710.11
5.1.00.0100.02710.05
5.0.50.0070.0438.58
5.0.40.0070.0378.57
5.0.30.0000.0678.26
5.0.20.0070.0278.21
5.0.10.0070.0378.10
5.0.00.0030.0478.18
4.4.90.0000.0207.80
4.4.80.0000.0177.80
4.4.70.0030.0277.80
4.4.60.0000.0377.80
4.4.50.0070.0337.80
4.4.40.0000.0277.80
4.4.30.0100.0277.80
4.4.20.0030.0337.80
4.4.10.0000.0307.80
4.4.00.0000.0507.80
4.3.110.0030.0337.80
4.3.100.0000.0377.80
4.3.90.0000.0237.80
4.3.80.0030.0337.80
4.3.70.0030.0137.80
4.3.60.0030.0177.80
4.3.50.0030.0137.80
4.3.40.0030.0537.80
4.3.30.0000.0207.80
4.3.20.0070.0137.80
4.3.10.0000.0377.80
4.3.00.0000.0207.80

preferences:
121.54 ms | 400 KiB | 5 Q