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){ 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.0140.00718.68
8.3.50.0120.00821.20
8.3.40.0040.01119.14
8.3.30.0070.00718.82
8.3.20.0040.00418.77
8.3.10.0080.00019.32
8.3.00.0040.00421.85
8.2.180.0300.00716.63
8.2.170.0090.00622.96
8.2.160.0210.00020.34
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0100.00018.05
8.2.110.0040.00419.28
8.2.100.0040.00717.91
8.2.90.0030.00619.36
8.2.80.0030.00518.05
8.2.70.0000.00817.75
8.2.60.0050.00318.04
8.2.50.0050.00318.07
8.2.40.0000.00818.22
8.2.30.0000.00819.78
8.2.20.0040.00417.91
8.2.10.0040.00417.84
8.2.00.0000.00817.74
8.1.280.0000.01425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00022.45
8.1.230.0060.00620.90
8.1.220.0050.00318.77
8.1.210.0040.00420.75
8.1.200.0060.00317.25
8.1.190.0030.00517.65
8.1.180.0030.00618.10
8.1.170.0040.00418.53
8.1.160.0000.00718.84
8.1.150.0050.00218.71
8.1.140.0040.00417.35
8.1.130.0030.00317.85
8.1.120.0050.00217.46
8.1.110.0000.00817.37
8.1.100.0000.00717.40
8.1.90.0050.00217.41
8.1.80.0070.00017.45
8.1.70.0040.00417.43
8.1.60.0040.00417.57
8.1.50.0050.00317.38
8.1.40.0000.00817.52
8.1.30.0030.00517.50
8.1.20.0040.00417.68
8.1.10.0050.00317.60
8.1.00.0060.00317.47
8.0.300.0030.00520.05
8.0.290.0040.00417.16
8.0.280.0040.00418.56
8.0.270.0000.00717.29
8.0.260.0000.00716.91
8.0.250.0070.00016.95
8.0.240.0080.00316.92
8.0.230.0040.00416.95
8.0.220.0000.00717.01
8.0.210.0040.00416.88
8.0.200.0030.00317.02
8.0.190.0000.00717.04
8.0.180.0000.00716.99
8.0.170.0070.00017.02
8.0.160.0000.00816.88
8.0.150.0060.00316.93
8.0.140.0000.00717.00
8.0.130.0030.00313.45
8.0.120.0000.00817.00
8.0.110.0000.00716.97
8.0.100.0030.00517.00
8.0.90.0000.00817.09
8.0.80.0160.00316.97
8.0.70.0040.00416.84
8.0.60.0000.00816.93
8.0.50.0040.00416.85
8.0.30.0140.00717.21
8.0.20.0100.00817.40
8.0.10.0000.00817.04
8.0.00.0100.01016.94
7.4.330.0050.00014.78
7.4.320.0000.00616.55
7.4.300.0030.00316.58
7.4.290.0000.00816.62
7.4.280.0040.00416.61
7.4.270.0000.00616.61
7.4.260.0000.00513.29
7.4.250.0070.00016.50
7.4.240.0000.00716.61
7.4.230.0070.00016.65
7.4.220.0030.01916.66
7.4.210.0070.00816.64
7.4.200.0000.00716.41
7.4.190.0000.00716.43
7.4.160.0160.00816.53
7.4.150.0170.00017.40
7.4.140.0070.01217.86
7.4.130.0070.01016.48
7.4.120.0070.01016.59
7.4.110.0140.00416.54
7.4.100.0100.01016.84
7.4.90.0070.01016.58
7.4.80.0150.01019.37
7.4.70.0080.00816.41
7.4.60.0060.01116.62
7.4.50.0040.00416.46
7.4.40.0060.00922.52
7.4.30.0120.00316.59
7.4.00.0070.00714.77
7.3.330.0000.00613.41
7.3.320.0030.00313.39
7.3.310.0060.00016.28
7.3.300.0070.00016.46
7.3.290.0070.00816.38
7.3.280.0040.01116.39
7.3.270.0030.01517.40
7.3.260.0100.01118.24
7.3.250.0070.01016.65
7.3.240.0070.01016.64
7.3.230.0100.01316.68
7.3.210.0060.01216.54
7.3.200.0170.00419.39
7.3.190.0040.01316.60
7.3.180.0110.00516.39
7.3.170.0060.01116.59
7.3.160.0110.00516.42
7.3.120.0030.01315.14
7.3.110.0100.01015.08
7.3.100.0030.01314.96
7.3.90.0040.01415.05
7.3.80.0090.00614.85
7.3.70.0000.01614.81
7.3.60.0070.00314.77
7.3.50.0070.01114.88
7.3.40.0090.00614.77
7.3.30.0000.01415.04
7.3.20.0040.00816.77
7.3.10.0090.00616.89
7.3.00.0110.00516.58
7.2.330.0130.00616.72
7.2.320.0060.01316.62
7.2.310.0110.00716.37
7.2.300.0110.00616.79
7.2.290.0060.01116.79
7.2.240.0090.00915.11
7.2.230.0040.01115.00
7.2.220.0000.01414.97
7.2.210.0000.01315.19
7.2.200.0060.00815.05
7.2.190.0070.01115.22
7.2.180.0100.00315.16
7.2.170.0040.01214.91
7.2.160.0040.01115.18
7.2.150.0040.00817.17
7.2.140.0040.01116.91
7.2.130.0050.00816.90
7.2.120.0060.00916.61
7.2.110.0080.00917.01
7.2.100.0070.00616.86
7.2.90.0050.01016.77
7.2.80.0090.00516.82
7.2.70.0080.00716.66
7.2.60.0070.00716.78
7.2.50.0070.00517.01
7.2.40.0120.00416.89
7.2.30.0100.00416.97
7.2.20.0080.00516.81
7.2.10.0060.01316.90
7.2.00.0100.00516.79
7.1.330.0080.00715.90
7.1.320.0070.00715.55
7.1.310.0060.00915.96
7.1.300.0060.00915.52
7.1.290.0080.00815.82
7.1.280.0150.00015.88
7.1.270.0000.00915.61
7.1.260.0000.01015.93
7.1.250.0090.00715.82
7.1.240.0100.00315.64
7.1.230.0110.00715.30
7.1.220.0130.00015.85
7.1.210.0130.00615.68
7.1.200.0070.00515.80
7.1.190.0030.01015.96
7.1.180.0120.00615.80
7.1.170.0130.00315.46
7.1.160.0050.00515.67
7.1.150.0090.00315.91
7.1.140.0000.01315.80
7.1.130.0110.00315.91
7.1.120.0070.01015.75
7.1.110.0090.00315.84
7.1.100.0070.00816.98
7.1.90.0150.00015.91
7.1.80.0060.00615.68
7.1.70.0000.01116.41
7.1.60.0110.00817.47
7.1.50.0030.01716.19
7.1.40.0090.00415.84
7.1.30.0060.00615.92
7.1.20.0030.01015.82
7.1.10.0080.00815.72
7.1.00.0050.04219.07
7.0.330.0060.00615.32
7.0.320.0130.00015.16
7.0.310.0080.00814.79
7.0.300.0090.00315.50
7.0.290.0060.00815.25
7.0.280.0060.00915.38
7.0.270.0070.00415.36
7.0.260.0130.00315.41
7.0.250.0090.00315.39
7.0.240.0100.00715.30
7.0.230.0030.01015.39
7.0.220.0070.00715.17
7.0.210.0080.00415.50
7.0.200.0080.00516.11
7.0.190.0100.00715.33
7.0.180.0030.01315.57
7.0.170.0180.00015.28
7.0.160.0040.00715.02
7.0.150.0060.00615.16
7.0.140.0060.04218.70
7.0.130.0110.00415.34
7.0.120.0030.00815.36
7.0.110.0120.00315.01
7.0.100.0120.00415.41
7.0.90.0090.00915.54
7.0.80.0100.00315.58
7.0.70.0070.03818.43
7.0.60.0090.02718.42
7.0.50.0090.02118.91
7.0.40.0110.02316.71
7.0.30.0020.04616.65
7.0.20.0050.04216.83
7.0.10.0070.03916.78
7.0.00.0110.04516.80
5.6.380.0030.00914.24
5.6.370.0050.00514.51
5.6.360.0000.00914.29
5.6.350.0000.01014.48
5.6.340.0000.01414.40
5.6.330.0030.01214.21
5.6.320.0130.00013.97
5.6.310.0030.01014.16
5.6.300.0040.00414.02
5.6.290.0030.00914.33
5.6.280.0040.04217.65
5.6.270.0090.00314.29
5.6.260.0080.00314.50
5.6.250.0100.00314.50
5.6.240.0100.00814.42
5.6.230.0040.00814.19
5.6.220.0080.02817.25
5.6.210.0070.04217.49
5.6.200.0000.02917.62
5.6.190.0000.03517.68
5.6.180.0080.02317.65
5.6.170.0110.04317.70
5.6.160.0130.04417.46
5.6.150.0120.04417.56
5.6.140.0100.04517.72
5.6.130.0120.05217.67
5.6.120.0100.04817.58
5.6.110.0120.04517.47
5.6.100.0110.03717.77
5.6.90.0050.03517.77
5.6.80.0120.03317.47
5.6.70.0120.02517.32
5.6.60.0080.04517.39
5.6.50.0130.03517.28
5.6.40.0120.04217.23
5.6.30.0120.04417.04
5.6.20.0190.02317.38
5.6.10.0100.04517.19
5.6.00.0090.04417.29
5.5.380.0050.00911.22
5.5.370.0030.01011.37
5.5.360.0120.03415.69
5.5.350.0040.02715.54
5.5.340.0020.02515.86
5.5.330.0040.02315.81
5.5.320.0030.03515.77
5.5.310.0070.04215.89
5.5.300.0110.04315.93
5.5.290.0110.04616.08
5.5.280.0090.04315.97
5.5.270.0130.04015.86
5.5.260.0100.03216.06
5.5.250.0050.02515.85
5.5.240.0050.04215.67
5.5.230.0030.04615.68
5.5.220.0110.03715.72
5.5.210.0100.04315.58
5.5.200.0090.03515.65
5.5.190.0080.04315.56
5.5.180.0090.03915.69
5.5.170.0100.00311.09
5.5.160.0040.04415.68
5.5.150.0140.04015.36
5.5.140.0080.04015.47
5.5.130.0080.04215.42
5.5.120.0080.04115.51
5.5.110.0060.03515.67
5.5.100.0090.04215.54
5.5.90.0120.04215.50
5.5.80.0130.03515.50
5.5.70.0100.03815.62
5.5.60.0100.03715.45
5.5.50.0100.03515.57
5.5.40.0110.03915.49
5.5.30.0080.02815.58
5.5.20.0070.03515.54
5.5.10.0110.03015.41
5.5.00.0110.03515.48
5.4.450.0050.04515.30
5.4.440.0120.04015.11
5.4.430.0040.03415.13
5.4.420.0140.03715.30
5.4.410.0080.04314.95
5.4.400.0080.03215.03
5.4.390.0100.01915.02
5.4.380.0090.03514.98
5.4.370.0030.04315.04
5.4.360.0080.03515.02
5.4.350.0160.03814.86
5.4.340.0050.03614.75
5.4.330.0110.00410.85
5.4.320.0110.03514.99
5.4.310.0140.03714.75
5.4.300.0140.02814.87
5.4.290.0130.03115.07
5.4.280.0030.04514.74
5.4.270.0030.03715.14
5.4.260.0060.04014.99
5.4.250.0070.03714.96
5.4.240.0080.03815.05
5.4.230.0140.03314.81
5.4.220.0190.03314.98
5.4.210.0140.04014.88
5.4.200.0060.03814.91
5.4.190.0100.02014.88
5.4.180.0120.03814.80
5.4.170.0100.03914.71
5.4.160.0100.04114.89
5.4.150.0050.04214.88
5.4.140.0100.03513.51
5.4.130.0090.04213.63
5.4.120.0100.02813.53
5.4.110.0060.02113.53
5.4.100.0100.02213.58
5.4.90.0020.02413.40
5.4.80.0070.01713.67
5.4.70.0020.04413.59
5.4.60.0060.01913.64
5.4.50.0000.02613.71
5.4.40.0060.01813.70
5.4.30.0040.02113.57
5.4.20.0050.01913.59
5.4.10.0050.02313.44
5.4.00.0010.02113.34
5.3.290.0070.03812.64
5.3.280.0080.03812.44
5.3.270.0080.04412.56
5.3.260.0060.04012.60
5.3.250.0110.03512.49
5.3.240.0060.03812.42
5.3.230.0080.04112.51
5.3.220.0050.02712.45
5.3.210.0080.02512.33
5.3.200.0050.02312.44
5.3.190.0030.01912.37
5.3.180.0050.02312.57
5.3.170.0070.01812.44
5.3.160.0060.01812.56
5.3.150.0050.03012.51
5.3.140.0020.02212.52
5.3.130.0040.02212.34
5.3.120.0030.02012.52
5.3.110.0000.02212.47
5.3.100.0050.02012.06
5.3.90.0050.02012.27
5.3.80.0050.03212.12
5.3.70.0030.03312.25
5.3.60.0020.02312.21
5.3.50.0000.02212.21
5.3.40.0020.02712.04
5.3.30.0050.02312.22
5.3.20.0050.02312.10
5.3.10.0060.02811.90
5.3.00.0040.03211.92
5.2.170.0020.03210.42
5.2.160.0020.03410.31
5.2.150.0040.03710.36
5.2.140.0030.03510.14
5.2.130.0000.01910.19
5.2.120.0110.02310.32
5.2.110.0070.01810.22
5.2.100.0060.03510.26
5.2.90.0060.01610.21
5.2.80.0000.03010.16
5.2.70.0050.03010.25
5.2.60.0050.02310.18
5.2.50.0030.0259.95
5.2.40.0020.03210.24
5.2.30.0050.03210.07
5.2.20.0040.02710.04
5.2.10.0030.03210.21
5.2.00.0030.0269.88
5.1.60.0000.0259.36
5.1.50.0040.0239.41
5.1.40.0050.0289.46
5.1.30.0020.0229.52
5.1.20.0040.0309.53
5.1.10.0100.0239.47
5.1.00.0100.0339.35
5.0.50.0120.0159.12
5.0.40.0030.0239.12
5.0.30.0040.0289.12
5.0.20.0040.0169.12
5.0.10.0040.0149.12
5.0.00.0030.0219.12
4.4.90.0040.0139.12
4.4.80.0030.0139.12
4.4.70.0000.0179.12
4.4.60.0000.0169.12
4.4.50.0000.0119.12
4.4.40.0030.0259.12
4.4.30.0020.0159.12
4.4.20.0070.0219.12
4.4.10.0050.0159.12
4.4.00.0010.0289.12
4.3.110.0030.0169.12
4.3.100.0020.0179.12
4.3.90.0030.0199.12
4.3.80.0050.0259.12
4.3.70.0040.0179.12
4.3.60.0030.0149.12
4.3.50.0030.0179.12
4.3.40.0090.0229.12
4.3.30.0080.0219.12
4.3.20.0100.0209.12
4.3.10.0000.0219.12
4.3.00.0170.0109.12

preferences:
42.93 ms | 400 KiB | 5 Q