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) { return !(is_array($token) && $token[0] === T_WHITESPACE); }); // 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.70.0080.00816.63
8.3.60.0090.00918.30
8.3.50.0090.00721.19
8.3.40.0040.01118.76
8.3.30.0070.00718.84
8.3.20.0050.00318.65
8.3.10.0080.00021.10
8.3.00.0080.00019.79
8.2.180.0080.00816.88
8.2.170.0040.01222.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00021.12
8.2.110.0060.00320.51
8.2.100.0030.00917.84
8.2.90.0030.00519.22
8.2.80.0030.00617.97
8.2.70.0030.00617.63
8.2.60.0060.00317.93
8.2.50.0000.00818.07
8.2.40.0080.00018.34
8.2.30.0070.00021.24
8.2.20.0000.00717.68
8.2.10.0080.00017.84
8.2.00.0060.00617.85
8.1.280.0130.00325.92
8.1.270.0030.00524.01
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.18
8.1.230.0110.00017.57
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0060.00317.48
8.1.190.0040.00417.53
8.1.180.0080.00018.10
8.1.170.0000.00818.58
8.1.160.0000.00718.99
8.1.150.0040.00418.75
8.1.140.0040.00417.45
8.1.130.0080.00017.81
8.1.120.0040.00417.55
8.1.110.0050.00317.45
8.1.100.0000.00817.45
8.1.90.0000.00717.53
8.1.80.0070.00017.39
8.1.70.0000.00717.47
8.1.60.0000.00917.65
8.1.50.0000.00817.57
8.1.40.0030.00717.55
8.1.30.0040.00417.66
8.1.20.0040.00417.62
8.1.10.0020.00517.63
8.1.00.0040.00417.55
8.0.300.0050.00218.77
8.0.290.0000.00716.75
8.0.280.0040.00418.54
8.0.270.0030.00317.18
8.0.260.0030.00316.82
8.0.250.0000.00716.87
8.0.240.0060.00316.90
8.0.230.0040.00416.93
8.0.220.0050.00316.95
8.0.210.0030.00316.96
8.0.200.0040.00417.00
8.0.190.0000.00717.02
8.0.180.0040.00416.86
8.0.170.0000.00716.96
8.0.160.0000.00716.95
8.0.150.0070.00016.94
8.0.140.0100.00016.90
8.0.130.0000.00513.34
8.0.120.0000.00816.83
8.0.110.0000.00716.81
8.0.100.0000.00816.79
8.0.90.0040.00416.97
8.0.80.0130.00916.93
8.0.70.0050.00316.87
8.0.60.0040.00416.94
8.0.50.0070.00017.00
8.0.30.0140.00517.11
8.0.20.0090.01217.42
8.0.10.0000.00716.88
8.0.00.0090.00916.71
7.4.330.0060.00015.03
7.4.320.0000.00616.64
7.4.300.0070.00016.52
7.4.290.0030.00316.68
7.4.280.0030.00316.54
7.4.270.0070.00016.59
7.4.260.0000.00613.34
7.4.250.0040.00416.41
7.4.240.0030.00316.64
7.4.230.0000.00816.75
7.4.220.0090.00916.59
7.4.210.0070.00816.59
7.4.200.0030.00316.34
7.4.190.0050.00316.46
7.4.160.0070.01016.64
7.4.150.0060.01117.40
7.4.140.0110.00617.86
7.4.130.0100.00916.39
7.4.120.0130.00816.54
7.4.110.0160.00316.52
7.4.100.0110.00816.47
7.4.90.0050.01416.59
7.4.80.0060.01219.39
7.4.70.0200.00416.45
7.4.60.0130.00516.79
7.4.50.0000.00816.39
7.4.40.0030.01322.77
7.4.30.0070.01216.41
7.4.00.0030.01015.08
7.3.330.0030.00313.36
7.3.320.0000.00513.16
7.3.310.0070.00016.39
7.3.300.0000.00816.46
7.3.290.0040.01416.38
7.3.280.0100.00916.44
7.3.270.0090.00917.40
7.3.260.0080.01018.24
7.3.250.0110.01016.58
7.3.240.0100.01416.38
7.3.230.0140.00316.39
7.3.210.0070.01116.72
7.3.200.0090.00919.39
7.3.190.0090.01516.43
7.3.180.0130.00316.42
7.3.170.0120.00416.38
7.3.160.0110.01116.50
7.3.120.0060.00814.96
7.2.330.0100.01016.79
7.2.320.0120.00816.54
7.2.310.0130.01116.49
7.2.300.0180.00016.85
7.2.290.0180.00316.89
7.2.00.0030.00919.59
7.1.100.0070.00718.01
7.1.70.0030.00617.23
7.1.60.0040.01117.32
7.1.50.0070.01417.08
7.1.40.0000.01216.40
7.1.30.0030.01916.65
7.1.20.0030.01016.73
7.1.10.0000.00816.53
7.1.00.0030.00816.88
7.0.200.0030.00616.69
7.0.190.0040.00416.71
7.0.180.0030.01216.25
7.0.170.0030.00916.29
7.0.160.0060.00316.19
7.0.150.0000.00916.24
7.0.140.0060.00916.44
7.0.130.0060.01216.65
7.0.120.0000.00916.68
7.0.110.0000.01016.36
7.0.100.0000.00716.35
7.0.90.0060.00916.36
7.0.80.0060.00316.47
7.0.70.0000.01416.46
7.0.60.0030.01016.21
7.0.50.0030.00616.37
7.0.40.0040.00415.54
7.0.30.0000.00915.54
7.0.20.0030.01015.54
7.0.10.0070.00315.54
7.0.00.0040.00415.54
5.6.300.0070.06620.59
5.6.290.0060.07720.76
5.6.280.0130.06221.06
5.6.270.0070.06620.94
5.6.260.0070.09220.93
5.6.250.0000.05020.83
5.6.240.0100.08621.01
5.6.230.0030.09720.86
5.6.220.0070.03720.98
5.6.210.0030.07420.61
5.6.200.0030.04920.85
5.6.190.0060.04220.89
5.6.180.0090.03420.79
5.6.170.0000.04921.00
5.6.160.0070.04121.06
5.6.150.0030.05020.95
5.6.140.0030.04421.04
5.6.130.0000.04620.88
5.6.120.0030.04621.00
5.6.110.0070.04021.04
5.6.100.0000.04620.86
5.6.90.0030.06120.93
5.6.80.0000.04920.33
5.6.70.0030.07520.21
5.6.60.0000.04520.16
5.6.50.0000.04320.36
5.6.40.0000.04220.33
5.6.30.0130.06920.30
5.6.20.0000.08220.18
5.6.10.0030.07720.30
5.6.00.0070.07420.29
5.5.380.0030.06317.55
5.5.370.0070.05217.43
5.5.360.0030.05617.65
5.5.350.0000.04617.53
5.5.340.0130.03018.10
5.5.330.0030.04018.12
5.5.320.0060.03518.13
5.5.310.0000.04118.04
5.5.300.0070.03918.09
5.5.290.0070.04017.84
5.5.280.0100.04417.72
5.5.270.0070.04917.74
5.5.260.0070.04718.17
5.5.250.0030.08517.68
5.5.240.0070.04217.56
5.5.230.0000.07517.47
5.5.220.0000.04317.46
5.5.210.0030.07617.46
5.5.200.0100.07417.39
5.5.190.0030.08017.19
5.5.180.0070.03717.47
5.5.160.0070.03517.10
5.5.150.0070.07517.18
5.5.140.0070.03617.44
5.5.130.0030.03917.05
5.5.120.0000.04317.09
5.5.110.0030.04217.44
5.5.100.0030.05917.34
5.5.90.0000.04517.11
5.5.80.0000.04016.96
5.5.70.0000.07816.95
5.5.60.0040.04217.36
5.5.50.0060.03217.27
5.5.40.0000.04517.34
5.5.30.0030.08216.98
5.5.20.0100.05317.30
5.5.10.0030.04217.37
5.5.00.0000.05117.09
5.4.450.0030.06019.41
5.4.440.0000.07019.54
5.4.430.0070.06119.31
5.4.420.0030.04419.41
5.4.410.0070.04819.23
5.4.400.0000.07319.21
5.4.390.0030.08619.16
5.4.380.0070.07219.07
5.4.370.0030.05419.29
5.4.360.0030.06218.93
5.4.350.0000.08719.21
5.4.340.0030.05718.90
5.4.320.0030.03818.92
5.4.310.0030.04419.09
5.4.300.0100.04919.00
5.4.290.0030.03719.18
5.4.280.0040.03919.13
5.4.270.0030.03718.91
5.4.260.0000.08519.13
5.4.250.0140.03718.89
5.4.240.0030.03719.13
5.4.230.0030.04419.23
5.4.220.0030.03818.95
5.4.210.0000.04818.92
5.4.200.0030.04119.20
5.4.190.0000.04819.06
5.4.180.0030.07219.08
5.4.170.0030.03819.06
5.4.160.0030.03819.09
5.4.150.0060.03519.04
5.4.140.0100.04516.68
5.4.130.0000.05916.56
5.4.120.0000.05216.52
5.4.110.0000.03816.74
5.4.100.0030.03416.48
5.4.90.0060.03716.61
5.4.80.0030.06816.60
5.4.70.0030.07616.50
5.4.60.0070.06916.62
5.4.50.0070.04816.40
5.4.40.0000.05816.73
5.4.30.0030.03616.71
5.4.20.0070.03316.72
5.4.10.0060.04516.74
5.4.00.0000.07515.98
5.3.290.0030.04215.54
5.3.280.0030.03915.54
5.3.270.0060.03815.54
5.3.260.0070.05115.54
5.3.250.0110.03515.54
5.3.240.0100.03015.54
5.3.230.0030.06215.54
5.3.220.0070.03315.54
5.3.210.0090.03815.54
5.3.200.0030.07115.54
5.3.190.0030.08215.54
5.3.180.0000.07615.54
5.3.170.0070.06315.54
5.3.160.0030.08015.54
5.3.150.0070.07515.54
5.3.140.0030.06815.54
5.3.130.0000.04015.54
5.3.120.0030.07415.54
5.3.110.0070.06415.54
5.3.100.0140.06815.54
5.3.90.0070.04915.54
5.3.80.0100.03015.54
5.3.70.0030.03815.54
5.3.60.0030.03515.54
5.3.50.0070.04815.54
5.3.40.0000.06615.54
5.3.30.0060.03215.54
5.3.20.0060.04215.54
5.3.10.0000.05015.54
5.3.00.0000.06215.54
5.2.170.0030.04115.54
5.2.160.0100.05215.54
5.2.150.0000.03415.54
5.2.140.0000.06215.54
5.2.130.0000.04115.54
5.2.120.0030.02715.54
5.2.110.0000.03015.54
5.2.100.0060.05415.54
5.2.90.0000.03915.54
5.2.80.0000.03315.54
5.2.70.0030.03415.54
5.2.60.0000.03215.54
5.2.50.0000.06615.54
5.2.40.0030.04015.54
5.2.30.0000.03315.54
5.2.20.0070.05015.54
5.2.10.0000.04515.54
5.2.00.0030.04315.54
5.1.60.0030.02315.54
5.1.50.0000.02615.54
5.1.40.0030.02215.54
5.1.30.0000.02915.54
5.1.20.0070.02515.54
5.1.10.0070.02615.54
5.1.00.0000.02715.54
5.0.50.0030.02015.54
5.0.40.0000.02115.54
5.0.30.0030.02815.54
5.0.20.0030.01815.54
5.0.10.0030.01715.54
5.0.00.0000.03615.54
4.4.90.0000.01715.54
4.4.80.0000.03815.54
4.4.70.0000.01715.54
4.4.60.0000.01715.54
4.4.50.0070.02615.54
4.4.40.0000.02815.54
4.4.30.0030.01615.54
4.4.20.0000.01715.54
4.4.10.0000.01915.54
4.4.00.0040.02215.54
4.3.110.0190.00615.54
4.3.100.0000.01715.54
4.3.90.0040.01215.54
4.3.80.0000.02515.54
4.3.70.0000.01715.54
4.3.60.0000.01715.54
4.3.50.0030.01315.54
4.3.40.0060.02115.54
4.3.30.0000.01915.54
4.3.20.0040.01515.54
4.3.10.0000.01615.54
4.3.00.0000.01615.54

preferences:
43.58 ms | 401 KiB | 5 Q