3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '((\'rats\' + \'stoats\') - 800 / 2)'; $tokens = token_get_all("{$input}"); $expr = ''; foreach($tokens as $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.0170.00716.75
8.3.50.0070.01217.33
8.3.40.0110.00318.96
8.3.30.0150.00318.97
8.3.20.0150.00319.02
8.3.10.0040.00420.64
8.3.00.0000.00819.25
8.2.180.0040.01116.75
8.2.170.0180.00322.96
8.2.160.0110.00321.14
8.2.150.0060.00324.18
8.2.140.0030.00524.66
8.2.130.0140.00326.16
8.2.120.0030.00521.02
8.2.110.0070.00321.13
8.2.100.0040.00717.93
8.2.90.0030.00720.90
8.2.80.0000.00817.93
8.2.70.0000.00817.75
8.2.60.0060.00317.78
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0000.00818.04
8.2.20.0040.00417.91
8.2.10.0060.00317.81
8.2.00.0040.00417.74
8.1.270.0060.00324.66
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0030.00722.50
8.1.230.0040.00820.59
8.1.220.0050.00317.74
8.1.210.0050.00318.91
8.1.200.0060.00317.25
8.1.190.0080.00017.63
8.1.180.0060.00318.10
8.1.170.0040.00418.76
8.1.160.0000.00718.85
8.1.150.0060.00318.57
8.1.140.0050.00217.43
8.1.130.0000.00717.92
8.1.120.0050.00317.53
8.1.110.0080.00017.37
8.1.100.0000.00717.46
8.1.90.0070.00017.50
8.1.80.0000.00717.43
8.1.70.0050.00317.37
8.1.60.0050.00317.64
8.1.50.0070.00017.51
8.1.40.0040.00417.43
8.1.30.0020.00517.70
8.1.20.0040.00417.52
8.1.10.0070.00017.54
8.1.00.0040.00417.47
8.0.300.0080.00019.91
8.0.290.0070.00016.75
8.0.280.0000.00718.43
8.0.270.0040.00417.29
8.0.260.0000.00716.84
8.0.250.0040.00416.94
8.0.240.0000.00716.95
8.0.230.0000.00816.97
8.0.220.0070.00016.89
8.0.210.0000.00716.96
8.0.200.0060.00016.93
8.0.190.0040.00416.88
8.0.180.0050.00316.92
8.0.170.0040.00417.01
8.0.160.0050.00216.95
8.0.150.0050.00416.92
8.0.140.0000.00716.79
8.0.130.0030.00313.42
8.0.120.0070.00016.97
8.0.110.0050.00216.88
8.0.100.0030.00516.92
8.0.90.0030.00516.84
8.0.80.0120.00316.95
8.0.70.0040.00417.03
8.0.60.0040.00416.78
8.0.50.0040.00416.79
8.0.30.0110.00916.95
8.0.20.0100.01217.10
8.0.10.0030.00617.18
8.0.00.0100.01216.68
7.4.330.0000.00513.15
7.4.320.0000.00616.52
7.4.300.0000.00616.54
7.4.290.0030.00316.61
7.4.280.0030.00616.53
7.4.270.0050.00216.46
7.4.260.0030.00313.33
7.4.250.0040.00416.51
7.4.240.0050.00216.52
7.4.230.0000.00716.67
7.4.220.0100.01016.56
7.4.210.0090.00616.59
7.4.200.0030.00316.61
7.4.190.0070.00016.50
7.4.160.0080.00816.43
7.4.150.0120.00616.50
7.4.140.0150.00716.48
7.4.130.0040.01416.49
7.4.120.0050.01216.67
7.4.110.0140.00316.50
7.4.100.0060.01116.45
7.4.90.0150.00316.54
7.4.80.0040.01419.39
7.4.70.0130.00316.58
7.4.60.0130.00316.60
7.4.50.0090.00316.34
7.4.40.0080.00316.20
7.4.30.0100.00616.63
7.4.00.0050.01214.90
7.3.330.0030.00313.23
7.3.320.0030.00413.45
7.3.310.0000.00716.45
7.3.300.0040.00416.40
7.3.290.0110.00516.43
7.3.280.0110.00716.38
7.3.270.0150.00316.59
7.3.260.0140.00316.34
7.3.250.0070.01016.54
7.3.240.0140.00316.43
7.3.230.0080.00816.61
7.3.210.0100.00616.39
7.3.200.0070.01316.30
7.3.190.0030.01416.40
7.3.180.0100.00616.54
7.3.170.0130.00816.59
7.3.160.0080.01116.64
7.3.120.0100.00514.97
7.3.110.0030.01414.79
7.3.100.0110.00515.04
7.3.90.0070.00714.84
7.3.80.0120.00014.77
7.3.70.0040.00414.85
7.3.60.0030.01015.04
7.3.50.0070.00714.93
7.3.40.0040.00414.75
7.3.30.0070.00714.87
7.3.20.0080.00616.70
7.3.10.0050.00916.55
7.3.00.0120.00816.72
7.2.330.0120.00616.85
7.2.320.0140.00516.41
7.2.310.0140.01016.66
7.2.300.0130.00716.72
7.2.290.0110.00516.61
7.2.250.0030.01314.77
7.2.240.0070.01114.92
7.2.230.0070.00715.09
7.2.220.0030.01015.21
7.2.210.0040.00714.83
7.2.200.0090.00015.22
7.2.190.0030.01015.09
7.2.180.0060.00615.09
7.2.170.0080.00414.84
7.2.160.0070.01114.77
7.2.150.0070.00317.00
7.2.140.0040.01116.77
7.2.130.0120.00716.99
7.2.120.0140.00716.82
7.2.110.0030.01016.79
7.2.100.0120.00516.75
7.2.90.0070.01016.94
7.2.80.0090.00716.85
7.2.70.0100.00916.84
7.2.60.0080.00416.74
7.2.50.0090.00816.80
7.2.40.0070.00716.99
7.2.30.0060.00917.07
7.2.20.0160.00716.90
7.2.10.0070.00516.95
7.2.00.0070.01117.81
7.1.330.0000.01515.95
7.1.320.0080.00615.55
7.1.310.0030.01015.69
7.1.300.0080.00415.94
7.1.290.0080.00015.59
7.1.280.0030.01015.64
7.1.270.0090.00915.90
7.1.260.0030.01315.74
7.1.250.0100.00915.78
7.1.240.0080.00615.75
7.1.230.0110.00415.81
7.1.220.0090.00615.72
7.1.210.0110.00415.83
7.1.200.0030.00915.90
7.1.190.0100.00315.84
7.1.180.0070.00715.61
7.1.170.0070.00715.82
7.1.160.0120.00315.92
7.1.150.0000.01315.70
7.1.140.0030.00715.93
7.1.130.0060.00915.95
7.1.120.0070.00715.61
7.1.110.0070.00415.86
7.1.100.0050.00517.04
7.1.90.0070.00416.00
7.1.80.0000.00815.99
7.1.70.0060.00816.64
7.1.60.0050.00417.60
7.1.50.0060.00816.50
7.1.40.0040.01116.06
7.1.30.0040.00715.87
7.1.20.0000.01015.64
7.1.10.0080.00815.98
7.1.00.0040.02319.04
7.0.330.0070.00715.68
7.0.320.0070.00715.22
7.0.310.0100.00715.50
7.0.300.0060.00615.35
7.0.290.0040.01115.42
7.0.280.0000.00915.51
7.0.270.0030.00615.62
7.0.260.0000.01115.18
7.0.250.0070.00315.43
7.0.240.0000.01215.52
7.0.230.0040.01115.43
7.0.220.0040.00815.43
7.0.210.0060.01115.43
7.0.200.0140.00716.07
7.0.190.0000.01215.37
7.0.180.0080.00415.46
7.0.170.0050.00315.37
7.0.160.0080.00815.23
7.0.150.0000.01215.57
7.0.140.0040.03918.84
7.0.130.0030.00915.27
7.0.120.0020.02918.85
7.0.110.0070.00715.25
7.0.100.0050.00315.31
7.0.90.0040.00715.38
7.0.80.0120.00015.47
7.0.70.0030.00915.46
7.0.60.0140.03817.71
7.0.50.0070.03216.65
7.0.40.0030.02816.76
7.0.30.0330.03816.76
7.0.20.0170.03716.81
7.0.10.0050.04316.87
7.0.00.0050.04516.77
5.6.400.0090.00614.45
5.6.390.0030.01014.02
5.6.380.0000.01014.27
5.6.370.0070.00714.25
5.6.360.0060.00614.72
5.6.350.0070.00714.58
5.6.340.0040.01114.41
5.6.330.0120.00314.33
5.6.320.0000.00914.52
5.6.310.0070.00714.36
5.6.300.0060.00314.70
5.6.290.0000.01514.47
5.6.280.0000.04217.67
5.6.270.0080.00414.31
5.6.260.0000.01414.20
5.6.250.0060.00614.54
5.6.240.0040.00814.47
5.6.230.0090.00314.40
5.6.220.0080.00814.49
5.6.210.0030.03817.48
5.6.200.0030.04316.31
5.6.190.0080.04017.48
5.6.180.0170.04217.43
5.6.170.0200.03917.41
5.6.160.0110.04316.29
5.6.150.0020.02716.26
5.6.140.0060.02116.39
5.6.130.0040.04816.33
5.6.120.0100.02817.71
5.6.110.0150.03217.71
5.6.100.0120.02417.59
5.6.90.0080.03217.64
5.6.80.0070.03217.27
5.6.70.0060.00914.33
5.6.60.0030.01014.50
5.6.50.0080.00614.15
5.6.40.0140.00014.27
5.6.30.0100.00714.22
5.6.20.0100.00314.46
5.6.10.0140.00314.34
5.6.00.0040.00414.19
5.5.380.0110.00413.84
5.5.370.0070.00313.83
5.5.360.0100.00014.48
5.5.350.0020.03717.30
5.5.340.0090.04116.20
5.5.330.0050.04317.15
5.5.320.0170.04517.32
5.5.310.0180.04717.23
5.5.300.0110.04216.12
5.5.290.0100.02516.29
5.5.280.0090.03617.61
5.5.270.0150.04017.40
5.5.260.0070.02517.46
5.5.250.0090.03717.31
5.5.240.0150.04317.11
5.5.230.0080.00414.38
5.5.220.0090.00614.34
5.5.210.0060.00614.03
5.5.200.0060.01014.01
5.5.190.0090.00314.16
5.5.180.0070.00714.08
5.5.170.0070.00713.77
5.5.160.0150.00013.93
5.5.150.0070.01013.77
5.5.140.0070.00714.50
5.5.130.0090.00313.92
5.5.120.0000.01514.26
5.5.110.0120.00013.97
5.5.100.0000.01614.08
5.5.90.0030.01014.10
5.5.80.0100.00314.30
5.5.70.0000.01313.94
5.5.60.0030.01214.19
5.5.50.0000.01314.05
5.5.40.0050.00814.31
5.5.30.0070.00714.08
5.5.20.0050.00814.41
5.5.10.0090.00914.02
5.5.00.0060.00914.30
5.4.450.0100.04015.29
5.4.440.0080.02715.43
5.4.430.0040.04315.20
5.4.420.0120.03715.27
5.4.410.0050.04215.23
5.4.400.0050.02914.97
5.4.390.0040.03815.06
5.4.380.0050.04315.02
5.4.370.0070.02915.13
5.4.360.0100.04315.10
5.4.350.0060.03715.21
5.4.340.0080.03115.10
5.4.330.0000.01211.04
5.4.320.0020.02815.23
5.4.310.0120.03514.97
5.4.300.0110.03615.02
5.4.290.0060.03814.91
5.4.280.0110.03815.17
5.4.270.0020.04215.10
5.4.260.0050.02414.94
5.4.250.0040.04214.99
5.4.240.0000.02414.91
5.4.230.0050.03315.10
5.4.220.0070.03715.12
5.4.210.0050.04215.05
5.4.200.0080.03414.95
5.4.190.0030.02915.10
5.4.180.0070.03015.18
5.4.170.0070.02814.93
5.4.160.0030.04215.13
5.4.150.0030.03614.93
5.4.140.0090.03213.79
5.4.130.0100.02313.77
5.4.120.0040.03413.71
5.4.110.0050.02813.67
5.4.100.0090.04113.75
5.4.90.0080.03813.63
5.4.80.0060.04013.65
5.4.70.0100.02013.85
5.4.60.0090.03613.73
5.4.50.0020.03413.64
5.4.40.0090.03713.73
5.4.30.0090.02413.63
5.4.20.0040.02613.73
5.4.10.0110.02613.79
5.4.00.0060.02813.42
5.3.290.0050.03912.73
5.3.280.0030.02712.69
5.3.270.0030.04012.76
5.3.260.0030.02512.75
5.3.250.0040.02212.77
5.3.240.0050.03812.79
5.3.230.0070.03012.68
5.3.220.0080.04012.72
5.3.210.0080.03812.75
5.3.200.0100.02612.73
5.3.190.0040.02612.74
5.3.180.0090.03412.72
5.3.170.0050.03312.75
5.3.160.0050.03812.72
5.3.150.0050.02312.71
5.3.140.0090.03312.72
5.3.130.0050.04412.74
5.3.120.0050.04012.72
5.3.110.0050.02712.71
5.3.100.0070.02112.44
5.3.90.0080.03712.48
5.3.80.0090.03612.46
5.3.70.0020.02712.47
5.3.60.0050.03012.47
5.3.50.0050.03912.43
5.3.40.0080.03912.37
5.3.30.0080.03112.40
5.3.20.0030.02712.37
5.3.10.0020.04412.30
5.3.00.0050.02412.29
5.2.170.0070.04711.11
5.2.160.0100.05711.06
5.2.150.0070.03311.15
5.2.140.0030.03011.14
5.2.130.0100.03711.06
5.2.120.0070.06011.05
5.2.110.0030.05310.99
5.2.100.0100.05711.12
5.2.90.0000.03711.02
5.2.80.0000.03011.01
5.2.70.0000.03011.11
5.2.60.0000.03011.05
5.2.50.0130.02010.87
5.2.40.0030.02710.96
5.2.30.0000.03010.99
5.2.20.0000.03311.06
5.2.10.0000.03010.93
5.2.00.0070.03010.88
5.1.60.0000.0239.91
5.1.50.0030.02310.06
5.1.40.0030.0209.90
5.1.30.0000.02710.23
5.1.20.0000.02710.41
5.1.10.0070.02010.05
5.1.00.0070.02010.08
5.0.50.0000.0238.54
5.0.40.0030.0178.49
5.0.30.0000.0308.19
5.0.20.0000.0238.12
5.0.10.0070.0138.23
5.0.00.0000.0308.13
4.4.90.0000.0207.71
4.4.80.0000.0177.71
4.4.70.0000.0177.71
4.4.60.0000.0177.71
4.4.50.0000.0177.71
4.4.40.0000.0237.71
4.4.30.0030.0177.71
4.4.20.0030.0137.71
4.4.10.0000.0177.71
4.4.00.0000.0237.71
4.3.110.0070.0107.71
4.3.100.0000.0137.71
4.3.90.0000.0137.71
4.3.80.0000.0237.71
4.3.70.0000.0137.71
4.3.60.0000.0137.71
4.3.50.0030.0107.71
4.3.40.0000.0237.71
4.3.30.0000.0137.71
4.3.20.0000.0177.71
4.3.10.0000.0137.71
4.3.00.0000.0137.71

preferences:
52.4 ms | 400 KiB | 5 Q