3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); ini_set('display_errors', 1); class system_tags { function __call($name, $params) { return '(METHOD "' . $name . '" WAS CALLED WITH PARAMS ' . implode(', ', $params) . ')'; } } class App { function run() { // Prerequisites. $system_tags = new system_tags(); $core = new \stdClass(); $core->tags = array( 'hello' => 'tagHelloMethod("$0", "hi")', 'world' => 'tagWorldMethod("$0", "world")', ); $this->template = 'Blah blah {hello} blah blah {world}.'; $this->withRegexReplaceCallback($core, $system_tags); echo $this->template . "\n"; } function withRegexReplaceCallback($core, $system_tags) { $callback = static function ($matches) use (& $tag_method, $system_tags) { $callback = function ($subMatches) use ($matches) { return $matches[$subMatches[1]]; }; $tag_method = preg_replace_callback('/(?:\\\\|\\$)(\d+)/', $callback, $tag_method); return eval('return $system_tags->' . $tag_method . ';'); }; foreach($core->tags as $tag_name => $tag_method) { $this->template = preg_replace_callback( '/\{' . preg_quote($tag_name) . '\}/', $callback, $this->template ); } } } $app = new App(); $app->run();

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.00616.73
8.3.50.0070.01122.09
8.3.40.0100.01019.07
8.3.30.0090.00619.23
8.3.20.0000.00720.36
8.3.10.0000.00721.90
8.3.00.0040.00419.50
8.2.180.0140.00418.54
8.2.170.0070.01419.04
8.2.160.0120.00622.96
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00319.91
8.2.110.0030.00620.38
8.2.100.0040.00818.04
8.2.90.0080.00018.34
8.2.80.0050.00318.00
8.2.70.0090.00017.88
8.2.60.0080.00317.93
8.2.50.0050.01018.07
8.2.40.0080.00020.01
8.2.30.0000.00718.33
8.2.20.0000.00917.97
8.2.10.0040.00418.13
8.2.00.0030.00617.84
8.1.280.0070.00725.92
8.1.270.0030.00620.74
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0030.00622.19
8.1.230.0120.00020.87
8.1.220.0040.00417.79
8.1.210.0050.00318.95
8.1.200.0060.00317.38
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00920.57
8.1.160.0000.00722.13
8.1.150.0000.00818.95
8.1.140.0000.00717.50
8.1.130.0000.00717.84
8.1.120.0070.00017.55
8.1.110.0060.00317.65
8.1.100.0040.00417.52
8.1.90.0030.00517.62
8.1.80.0070.00017.62
8.1.70.0000.00817.67
8.1.60.0030.00617.70
8.1.50.0040.00417.73
8.1.40.0020.00517.73
8.1.30.0040.00417.89
8.1.20.0030.00517.82
8.1.10.0000.00817.73
8.1.00.0000.00817.72
8.0.300.0070.00020.04
8.0.290.0040.00416.88
8.0.280.0070.00018.40
8.0.270.0040.00417.28
8.0.260.0030.00317.32
8.0.250.0030.00317.13
8.0.240.0030.00317.16
8.0.230.0000.00717.18
8.0.220.0040.00416.97
8.0.210.0000.00716.93
8.0.200.0030.00317.21
8.0.190.0050.00317.03
8.0.180.0030.00516.97
8.0.170.0000.00816.93
8.0.160.0030.00516.96
8.0.150.0050.00317.00
8.0.140.0030.00616.92
8.0.130.0030.00313.48
8.0.120.0040.00417.08
8.0.110.0000.00716.95
8.0.100.0030.00617.10
8.0.90.0050.00217.05
8.0.80.0070.01417.12
8.0.70.0050.00317.01
8.0.60.0000.00817.00
8.0.50.0000.00716.93
8.0.30.0140.00817.46
8.0.20.0110.01417.46
8.0.10.0000.00817.25
8.0.00.0110.00716.96
7.4.330.0030.00315.18
7.4.320.0050.00216.81
7.4.300.0000.00616.83
7.4.290.0030.00316.74
7.4.280.0030.00616.67
7.4.270.0030.00316.64
7.4.260.0040.00416.79
7.4.250.0040.00416.82
7.4.240.0010.00616.79
7.4.230.0000.00716.56
7.4.220.0090.01616.74
7.4.210.0060.00916.82
7.4.200.0030.00516.93
7.4.160.0000.01716.61
7.4.150.0070.01117.40
7.4.140.0120.01317.86
7.4.130.0050.01316.70
7.4.120.0100.00816.71
7.4.110.0030.02116.82
7.4.100.0190.00316.76
7.4.90.0110.00816.69
7.4.80.0030.01319.39
7.4.70.0160.00616.64
7.4.60.0100.00616.77
7.4.50.0040.00416.85
7.4.40.0090.00916.71
7.4.30.0120.00616.86
7.4.00.0100.00015.22
7.3.330.0000.00713.41
7.3.320.0080.00413.54
7.3.310.0070.00016.44
7.3.300.0040.00416.51
7.3.290.0040.00416.40
7.3.280.0100.00716.53
7.3.270.0000.01717.40
7.3.260.0150.00316.62
7.3.250.0140.00916.54
7.3.240.0090.01216.61
7.3.230.0070.01116.70
7.3.210.0030.01316.69
7.3.200.0060.01219.39
7.3.190.0120.00916.64
7.3.180.0060.00916.60
7.3.170.0170.00016.60
7.3.160.0070.01016.74
7.2.330.0030.01716.82
7.2.320.0130.00316.74
7.2.310.0150.00916.92
7.2.300.0070.01016.81
7.2.290.0040.01416.98
7.2.60.0030.01317.11
7.2.00.0080.00419.54
7.1.200.0060.00615.88
7.1.100.0120.00618.27
7.1.70.0040.00417.39
7.1.60.0140.01119.50
7.1.50.0100.01317.11
7.1.00.0000.08022.53
7.0.200.0550.00615.05
7.0.140.0070.06722.01
7.0.60.0030.04019.91
7.0.50.0070.03717.92
7.0.40.0070.07320.16
7.0.30.0200.06720.18
7.0.20.0270.05720.26
7.0.10.0270.05720.16
7.0.00.0070.08720.27
5.6.280.0030.07321.10
5.6.210.0070.08320.66
5.6.200.0100.07718.19
5.6.190.0070.06720.47
5.6.180.0230.04720.32
5.6.170.0300.06720.57
5.6.160.0070.04320.46
5.6.150.0070.03718.17
5.6.140.0130.03018.27
5.6.130.0100.06318.15
5.6.120.0070.06021.07
5.6.110.0070.08321.11
5.6.100.0070.08721.04
5.6.90.0030.08021.01
5.6.80.0100.06020.46
5.6.70.0100.08720.52
5.5.350.0130.08020.54
5.5.340.0000.04317.98
5.5.330.0030.04320.25
5.5.320.0070.06720.40
5.5.310.0230.07020.34
5.5.300.0070.08018.01
5.5.290.0030.08318.10
5.5.280.0070.05021.00
5.5.270.0100.05720.98
5.5.260.0000.08320.90
5.5.250.0030.07720.73
5.5.240.0100.03320.14
5.4.450.0630.06019.55
5.4.440.1070.05319.39
5.4.430.0100.05319.33
5.4.420.0900.05319.58
5.4.410.0930.05319.45
5.4.400.0230.05318.77
5.4.390.0270.05018.54
5.4.380.0170.06318.49
5.4.370.0200.05718.74
5.4.360.0300.05018.61
5.4.350.0300.05318.59
5.4.340.0270.06018.55
5.4.320.0400.04718.89
5.4.310.0270.05018.80
5.4.300.0230.05318.58
5.4.290.0300.05318.49
5.4.280.0230.05318.78
5.4.270.0230.05318.54
5.4.260.0270.05318.51
5.4.250.0300.05018.79
5.4.240.0200.08318.76
5.4.230.0270.05318.69
5.4.220.0330.05018.53
5.4.210.0270.05018.79
5.4.200.0300.04316.59
5.4.190.0270.05318.77
5.4.180.0200.06018.58
5.4.170.0330.05318.58
5.4.160.0230.05318.46
5.4.150.0270.05318.49
5.4.140.0270.06316.30
5.4.130.0270.04316.29
5.4.120.0230.05016.19
5.4.110.0130.05716.31
5.4.100.0170.06016.48
5.4.90.0400.03716.31
5.4.80.0370.05316.29
5.4.70.0330.05316.25
5.4.60.0270.05016.23
5.4.50.0230.05316.29
5.4.40.0230.05316.32
5.4.30.0170.06016.30
5.4.20.0200.05716.28
5.4.10.0200.07016.43
5.4.00.0130.06015.76
5.3.290.0300.05314.86
5.3.280.0270.05314.65
5.3.270.0270.05014.66
5.3.260.0230.05314.73
5.3.250.0270.05314.82
5.3.240.0270.05014.82
5.3.230.0230.05714.71
5.3.220.0300.04314.68
5.3.210.0230.05714.68
5.3.200.0300.05714.86
5.3.190.0170.06014.70
5.3.180.0230.05314.63
5.3.170.0330.06014.62
5.3.160.0270.04314.63
5.3.150.0200.05714.62
5.3.140.0330.04714.77
5.3.130.0130.06014.54
5.3.120.0230.06314.66
5.3.110.0200.05314.61
5.3.100.0430.04014.14
5.3.90.0400.04014.14
5.3.80.0230.05314.16
5.3.70.0230.05014.06
5.3.60.0200.05314.04
5.3.50.0230.05014.13
5.3.40.0300.04314.09
5.3.30.0200.05713.98
5.3.20.0300.04313.79
5.3.10.0170.06713.66
5.3.00.0130.06013.79
5.2.170.0170.04311.17
5.2.160.0200.04011.18
5.2.150.0130.04711.36
5.2.140.0130.04711.18
5.2.130.0200.03711.19
5.2.120.0170.04711.15
5.2.110.0300.03711.15
5.2.100.0230.04311.11
5.2.90.0270.03711.15
5.2.80.0200.04711.18
5.2.70.0230.04311.21
5.2.60.0270.03311.06
5.2.50.0200.05010.97
5.2.40.0200.05311.05
5.2.30.0130.04311.07
5.2.20.0170.04011.08
5.2.10.0200.03710.88
5.2.00.0070.04710.83
5.1.60.0100.04010.05
5.1.50.0170.03310.19
5.1.40.0270.04310.01
5.1.30.0100.04010.39
5.1.20.0170.03710.50
5.1.10.0130.04010.21
5.1.00.0100.04010.13
5.0.50.0200.0238.55
5.0.40.0070.0338.43
5.0.30.0170.0508.27
5.0.20.0070.0338.23
5.0.10.0070.0338.19
5.0.00.0100.0438.22
4.4.90.0100.0205.91
4.4.80.0100.0205.90
4.4.70.0030.0275.87
4.4.60.0100.0235.88
4.4.50.0100.0205.89
4.4.40.0100.0335.95
4.4.30.0170.0135.90
4.4.20.0100.0205.96
4.4.10.0070.0235.96
4.4.00.0070.0336.03
4.3.110.0030.0335.93
4.3.100.0100.0175.85
4.3.90.0030.0275.85
4.3.80.0030.0405.80
4.3.70.0070.0235.81
4.3.60.0100.0235.83
4.3.50.0070.0235.79
4.3.40.0030.0375.77
4.3.30.0100.0234.64
4.3.20.0030.0234.53
4.3.10.0070.0204.50
4.3.00.0100.0237.32

preferences:
79.44 ms | 401 KiB | 5 Q