3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test; $function = function () { return $a + $b . "Hello {$c} World!"; }; // Reflect the closure and fetch relevant properties $reflection = new \ReflectionFunction($function); $fileName = $reflection->getFileName(); $startLine = $reflection->getStartLine(); $endLine = $reflection->getEndLine(); // Slice out the lines $lines = array_slice(file($fileName), $startLine - 1, ($endLine - $startLine) + 1); $code = sprintf('<?php %s ; ?>', implode($lines)); // Tokenize and filter T_WHITESPACE $tokens = array_filter(token_get_all($code), function ($token) { if (is_array($token)) { if ($token[0] == T_WHITESPACE) { return false; } } return true; }); // Dump for shits and giggles foreach ($tokens as $token) { echo PHP_EOL; if (is_array($token)) { echo str_pad(token_name($token[0]), 30, '.') . trim($token[1]); continue; } echo str_pad('SYMBOL', 30, '.') . $token; }

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.0090.00618.56
8.3.50.0160.01221.21
8.3.40.0110.00418.97
8.3.30.0100.00618.59
8.3.20.0050.00318.75
8.3.10.0050.00321.16
8.3.00.0080.00019.68
8.2.180.0150.00018.31
8.2.170.0080.00822.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0060.00317.75
8.2.110.0060.00320.53
8.2.100.0090.00317.72
8.2.90.0080.00019.36
8.2.80.0060.00317.97
8.2.70.0070.00317.63
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0050.00318.14
8.2.30.0070.00019.54
8.2.20.0030.00617.81
8.2.10.0000.00817.80
8.2.00.0100.00017.87
8.1.280.0140.00425.92
8.1.270.0030.00622.11
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0110.00022.31
8.1.230.0070.00420.96
8.1.220.0030.00618.77
8.1.210.0000.00918.90
8.1.200.0040.00417.36
8.1.190.0040.00417.41
8.1.180.0030.00518.10
8.1.170.0080.00018.57
8.1.160.0000.00718.86
8.1.150.0000.00718.69
8.1.140.0070.00017.43
8.1.130.0000.00717.93
8.1.120.0000.00817.40
8.1.110.0040.00417.41
8.1.100.0030.00617.50
8.1.90.0020.00517.43
8.1.80.0030.00517.51
8.1.70.0030.00317.41
8.1.60.0030.00617.66
8.1.50.0040.00417.45
8.1.40.0030.00617.57
8.1.30.0040.00417.73
8.1.20.0060.00317.61
8.1.10.0080.00017.64
8.1.00.0040.00417.59
8.0.300.0070.00019.88
8.0.290.0090.00017.43
8.0.280.0000.00718.45
8.0.270.0070.00017.30
8.0.260.0000.00716.75
8.0.250.0050.00216.98
8.0.240.0000.00817.00
8.0.230.0070.00016.96
8.0.220.0070.00017.00
8.0.210.0070.00016.91
8.0.200.0030.00316.96
8.0.190.0080.00016.96
8.0.180.0030.00516.96
8.0.170.0040.00416.98
8.0.160.0070.00016.88
8.0.150.0040.00416.90
8.0.140.0070.00316.80
8.0.130.0030.00313.29
8.0.120.0030.00516.88
8.0.110.0040.00416.89
8.0.100.0040.00416.89
8.0.90.0000.00716.83
8.0.80.0130.00316.85
8.0.70.0050.00216.79
8.0.60.0040.00416.83
8.0.50.0030.00516.89
8.0.30.0110.00817.05
8.0.20.0140.00517.40
8.0.10.0070.00016.97
8.0.00.0090.00916.89
7.4.330.0020.00215.08
7.4.320.0060.00016.55
7.4.300.0040.00416.41
7.4.290.0000.00816.53
7.4.280.0030.00316.46
7.4.270.0040.00416.67
7.4.260.0030.00313.35
7.4.250.0080.00016.52
7.4.240.0030.00416.50
7.4.230.0070.00016.58
7.4.220.0090.00916.44
7.4.210.0050.00916.63
7.4.200.0030.00316.55
7.4.190.0000.00716.54
7.4.160.0120.00616.44
7.4.150.0090.00917.40
7.4.140.0060.01417.86
7.4.130.0080.01216.55
7.4.120.0090.01016.52
7.4.110.0060.01516.79
7.4.100.0070.01716.52
7.4.90.0040.01616.52
7.4.80.0030.01719.39
7.4.70.0070.01016.39
7.4.60.0100.01316.40
7.4.50.0040.00416.21
7.4.40.0070.00722.77
7.4.30.0120.00616.53
7.4.00.0070.00714.89
7.3.330.0030.00313.13
7.3.320.0030.00313.36
7.3.310.0000.00716.46
7.3.300.0030.00316.46
7.3.290.0030.01016.38
7.3.280.0110.00616.40
7.3.270.0090.01617.40
7.3.260.0060.01218.24
7.3.250.0100.01716.61
7.3.240.0180.00416.42
7.3.230.0110.01416.59
7.3.210.0150.00316.34
7.3.200.0030.01419.39
7.3.190.0070.01016.43
7.3.180.0090.00616.41
7.3.170.0140.00616.54
7.3.160.0060.01616.52
7.3.120.0040.01214.80
7.2.330.0120.00616.71
7.2.320.0100.01016.93
7.2.310.0130.01016.41
7.2.300.0100.00716.63
7.2.290.0100.00616.82
7.2.00.0000.01419.19
7.1.100.0030.00618.27
7.1.70.0000.01017.18
7.1.60.0040.00817.27
7.1.50.0040.00716.98
7.1.40.0060.00916.62
7.1.30.0000.01316.68
7.1.20.0040.00816.78
7.1.10.0040.00816.66
7.1.00.0050.00316.66
7.0.200.0000.00816.82
7.0.190.0110.00016.55
7.0.180.0040.00716.20
7.0.170.0040.00716.29
7.0.160.0050.00316.06
7.0.150.0000.00916.20
7.0.140.0070.00316.45
7.0.130.0030.00716.54
7.0.120.0070.00716.68
7.0.110.0030.00716.22
7.0.100.0040.00416.53
7.0.90.0000.01416.44
7.0.80.0050.00216.58
7.0.70.0000.00716.52
7.0.60.0040.00716.33
7.0.50.0060.00916.48
7.0.40.0040.00414.62
7.0.30.0060.00314.62
7.0.20.0000.00814.62
7.0.10.0020.00514.62
7.0.00.0070.00314.72
5.6.300.0000.04720.67
5.6.290.0260.03920.59
5.6.280.0070.04621.07
5.6.270.0070.04620.93
5.6.260.0000.05520.83
5.6.250.0040.03921.06
5.6.240.0070.06321.07
5.6.230.0030.04021.01
5.6.220.0030.04020.95
5.6.210.0030.05320.95
5.6.200.0000.04320.99
5.6.190.0000.05620.75
5.6.180.0070.04020.83
5.6.170.0000.04421.04
5.6.160.0030.04420.94
5.6.150.0140.04121.02
5.6.140.0030.04620.84
5.6.130.0060.03821.04
5.6.120.0030.04420.79
5.6.110.0070.04420.77
5.6.100.0070.04420.78
5.6.90.0100.03721.03
5.6.80.0070.03920.22
5.6.70.0040.03920.37
5.6.60.0030.04920.16
5.6.50.0030.03820.45
5.6.40.0000.05620.30
5.6.30.0100.03620.22
5.6.20.0200.04620.17
5.6.10.0030.04120.26
5.6.00.0030.04420.31
5.5.380.0140.03517.64
5.5.370.0030.04217.54
5.5.360.0030.07317.63
5.5.350.0030.04517.53
5.5.340.0070.04317.70
5.5.330.0000.04618.09
5.5.320.0060.03918.00
5.5.310.0000.04618.05
5.5.300.0070.04418.13
5.5.290.0090.03818.18
5.5.280.0070.04618.05
5.5.270.0100.03518.12
5.5.260.0030.05018.12
5.5.250.0000.04717.67
5.5.240.0070.03617.13
5.5.230.0030.04517.25
5.5.220.0030.04117.41
5.5.210.0060.03917.26
5.5.200.0090.03417.06
5.5.190.0030.04217.40
5.5.180.0070.03917.48
5.5.160.0070.03817.36
5.5.150.0040.03917.21
5.5.140.0070.03917.43
5.5.130.0030.03817.44
5.5.120.0040.04317.18
5.5.110.0000.05017.44
5.5.100.0030.03917.43
5.5.90.0070.03917.30
5.5.80.0000.04617.34
5.5.70.0030.04117.24
5.5.60.0000.04016.98
5.5.50.0000.04517.11
5.5.40.0040.04617.25
5.5.30.0070.03516.98
5.5.20.0120.03817.28
5.5.10.0100.03417.09
5.5.00.0030.06417.33
5.4.450.0130.04019.32
5.4.440.0030.04219.43
5.4.430.0070.03619.30
5.4.420.0030.04119.25
5.4.410.0060.03819.36
5.4.400.0030.03818.96
5.4.390.0030.03819.23
5.4.380.0030.03719.04
5.4.370.0060.03518.93
5.4.360.0070.03518.95
5.4.350.0000.05019.12
5.4.340.0070.04919.21
5.4.320.0000.04419.11
5.4.310.0040.03719.08
5.4.300.0070.04019.14
5.4.290.0030.03919.21
5.4.280.0030.04019.14
5.4.270.0110.03519.17
5.4.260.0060.03419.20
5.4.250.0030.04718.94
5.4.240.0030.03919.04
5.4.230.0070.03719.20
5.4.220.0060.05519.20
5.4.210.0030.03819.13
5.4.200.0120.05219.13
5.4.190.0030.03819.03
5.4.180.0090.03119.23
5.4.170.0070.05919.06
5.4.160.0090.03319.21
5.4.150.0030.04318.92
5.4.140.0040.03616.63
5.4.130.0030.03516.48
5.4.120.0030.04816.51
5.4.110.0040.03616.71
5.4.100.0030.03616.66
5.4.90.0040.03616.74
5.4.80.0030.03516.72
5.4.70.0030.03716.47
5.4.60.0060.03516.72
5.4.50.0070.03116.59
5.4.40.0070.03616.67
5.4.30.0030.03716.45
5.4.20.0030.04016.77
5.4.10.0260.03216.61
5.4.00.0030.03415.96
5.3.290.0030.04114.75
5.3.280.0000.04114.81
5.3.270.0070.04614.90
5.3.260.0070.04014.82
5.3.250.0070.03614.69
5.3.240.0030.03614.83
5.3.230.0100.03314.82
5.3.220.0070.04314.89
5.3.210.0000.04314.78
5.3.200.0110.03914.88
5.3.190.0160.03514.66
5.3.180.0000.04114.87
5.3.170.0030.03914.62
5.3.160.0100.03214.88
5.3.150.0070.03614.77
5.3.140.0060.04814.87
5.3.130.0090.03414.78
5.3.120.0030.03714.62
5.3.110.0210.04214.64
5.3.100.0030.03814.62
5.3.90.0030.03414.62
5.3.80.0000.04414.62
5.3.70.0060.03614.62
5.3.60.0000.04214.62
5.3.50.0030.03514.62
5.3.40.0030.03814.62
5.3.30.0040.03514.62
5.3.20.0060.03014.62
5.3.10.0030.05714.62
5.3.00.0030.03914.62
5.2.170.0030.05914.62
5.2.160.0060.02814.62
5.2.150.0040.03214.62
5.2.140.0100.04914.62
5.2.130.0000.03214.62
5.2.120.0030.02814.62
5.2.110.0000.03014.62
5.2.100.0060.02814.62
5.2.90.0030.03114.62
5.2.80.0030.02814.62
5.2.70.0000.03914.62
5.2.60.0030.03714.62
5.2.50.0030.02814.62
5.2.40.0030.04714.62
5.2.30.0030.03014.62
5.2.20.0030.02814.62
5.2.10.0120.02114.62
5.2.00.0030.02814.62
5.1.60.0000.02814.62
5.1.50.0000.02914.62
5.1.40.0030.02414.62
5.1.30.0070.02314.62
5.1.20.0000.03014.62
5.1.10.0090.02114.62
5.1.00.0060.02914.62
5.0.50.0000.02214.62
5.0.40.0000.02614.62
5.0.30.0070.04914.62
5.0.20.0070.01614.62
5.0.10.0000.02214.62
5.0.00.0030.03014.62
4.4.90.0070.02314.62
4.4.80.0060.01214.62
4.4.70.0000.01714.62
4.4.60.0120.00914.62
4.4.50.0000.02014.62
4.4.40.0030.02714.62
4.4.30.0060.01214.62
4.4.20.0040.01414.62
4.4.10.0000.01714.62
4.4.00.0030.02814.62
4.3.110.0000.01714.62
4.3.100.0030.02014.62
4.3.90.0030.01514.62
4.3.80.0030.02214.62
4.3.70.0030.01314.62
4.3.60.0000.03414.62
4.3.50.0000.01914.62
4.3.40.0030.02314.62
4.3.30.0100.01314.62
4.3.20.0030.02114.62
4.3.10.0000.02214.62
4.3.00.0030.01314.62

preferences:
43.57 ms | 401 KiB | 5 Q