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", "foo")', 'world' => 'tagWorldMethod("$0", "bar")', ); $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.0070.00717.09
8.3.50.0150.00622.12
8.3.40.0070.01119.08
8.3.30.0090.00619.36
8.3.20.0050.00320.25
8.3.10.0000.00721.91
8.3.00.0080.00019.50
8.2.180.0120.00918.42
8.2.170.0180.00322.96
8.2.160.0180.00420.52
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00019.69
8.2.110.0030.00621.13
8.2.100.0060.00617.75
8.2.90.0050.00519.30
8.2.80.0000.00817.97
8.2.70.0090.00017.88
8.2.60.0090.00017.93
8.2.50.0080.00818.07
8.2.40.0050.00320.13
8.2.30.0030.00518.20
8.2.20.0040.00417.90
8.2.10.0050.00318.29
8.2.00.0040.00418.07
8.1.280.0090.01225.92
8.1.270.0040.00420.53
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0060.00323.79
8.1.230.0080.00418.89
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.48
8.1.190.0050.00317.35
8.1.180.0050.00318.10
8.1.170.0040.00420.38
8.1.160.0080.00022.04
8.1.150.0040.00418.86
8.1.140.0040.00417.57
8.1.130.0000.00717.75
8.1.120.0020.00517.54
8.1.110.0000.00717.68
8.1.100.0030.00517.64
8.1.90.0040.00417.66
8.1.80.0000.00717.64
8.1.70.0040.00417.61
8.1.60.0000.00817.76
8.1.50.0030.00517.65
8.1.40.0000.00817.71
8.1.30.0030.00517.66
8.1.20.0000.00817.72
8.1.10.0000.00817.71
8.1.00.0040.00417.68
8.0.300.0040.00418.77
8.0.290.0080.00016.75
8.0.280.0070.00018.49
8.0.270.0040.00417.25
8.0.260.0000.00717.18
8.0.250.0030.00316.99
8.0.240.0080.00016.96
8.0.230.0040.00417.01
8.0.220.0000.00716.98
8.0.210.0070.00017.09
8.0.200.0000.00717.13
8.0.190.0040.00417.16
8.0.180.0050.00316.98
8.0.170.0000.00917.09
8.0.160.0050.00517.07
8.0.150.0070.00017.05
8.0.140.0050.00317.07
8.0.130.0000.00713.37
8.0.120.0000.00816.89
8.0.110.0000.00717.02
8.0.100.0070.00017.13
8.0.90.0050.00316.93
8.0.80.0030.01317.08
8.0.70.0040.00417.02
8.0.60.0040.00417.06
8.0.50.0000.00717.16
8.0.30.0070.01217.23
8.0.20.0080.01917.40
8.0.10.0030.00517.13
8.0.00.0110.01116.84
7.4.330.0030.00315.03
7.4.320.0030.00316.74
7.4.300.0030.00316.74
7.4.290.0070.00016.72
7.4.280.0040.00416.63
7.4.270.0070.00016.63
7.4.260.0040.00416.83
7.4.250.0040.00416.77
7.4.240.0010.00716.68
7.4.230.0000.00716.81
7.4.220.0140.00616.88
7.4.210.0080.00716.86
7.4.200.0000.00716.62
7.4.160.0100.00716.50
7.4.150.0120.00617.40
7.4.140.0130.00817.86
7.4.130.0110.01016.80
7.4.120.0130.00416.89
7.4.110.0170.00716.82
7.4.100.0070.01116.71
7.4.90.0110.00716.82
7.4.80.0100.00719.39
7.4.70.0140.00916.82
7.4.60.0030.01416.71
7.4.50.0050.00016.76
7.4.40.0100.01016.59
7.4.30.0100.01316.83
7.4.00.0070.00715.18
7.3.330.0030.00313.32
7.3.320.0060.00613.40
7.3.310.0030.00316.60
7.3.300.0000.00716.59
7.3.290.0000.00716.45
7.3.280.0090.00916.47
7.3.270.0110.00717.40
7.3.260.0090.00916.87
7.3.250.0040.01416.70
7.3.240.0120.00616.82
7.3.230.0100.00716.40
7.3.210.0000.01616.56
7.3.200.0100.00719.39
7.3.190.0070.01016.77
7.3.180.0090.00616.66
7.3.170.0140.00416.78
7.3.160.0060.00916.63
7.3.10.0080.00416.82
7.3.00.0020.01316.88
7.2.330.0290.01216.85
7.2.320.0070.01016.88
7.2.310.0100.01416.87
7.2.300.0070.01016.77
7.2.290.0060.01616.86
7.2.130.0060.00817.15
7.2.120.0050.00817.04
7.2.110.0050.00717.22
7.2.100.0050.00517.04
7.2.90.0090.00517.27
7.2.80.0020.00817.10
7.2.70.0050.00817.21
7.2.60.0070.00716.97
7.2.50.0050.00817.34
7.2.40.0040.01017.27
7.2.30.0030.01017.25
7.2.20.0080.00617.07
7.2.10.0040.00817.12
7.2.00.0060.00817.90
7.1.250.0050.00716.10
7.1.200.0030.00916.18
7.1.100.0140.00718.14
7.1.70.0030.00517.27
7.1.60.0110.01419.50
7.1.50.0070.01517.04
7.1.00.0030.07322.47
7.0.200.0730.00314.75
7.0.140.0070.07322.16
7.0.60.0130.04019.98
7.0.50.0100.07317.86
7.0.40.0030.04320.42
7.0.30.0200.04020.26
7.0.20.0370.07020.35
7.0.10.0330.08320.18
7.0.00.0030.09020.22
5.6.280.0100.06720.84
5.6.210.0100.03320.79
5.6.200.0100.06318.29
5.6.190.0130.08020.49
5.6.180.0200.05020.46
5.6.170.0270.07720.57
5.6.160.0030.04720.39
5.6.150.0100.07318.27
5.6.140.0070.08318.14
5.6.130.0030.04018.16
5.6.120.0030.04321.05
5.6.110.0030.08321.06
5.6.100.0030.09320.99
5.6.90.0200.05021.00
5.6.80.0070.07720.53
5.5.350.0070.06020.37
5.5.340.0130.05018.09
5.5.330.0000.04720.43
5.5.320.0100.08320.57
5.5.310.0300.07320.34
5.5.300.0070.08718.07
5.5.290.0100.08317.98
5.5.280.0070.07720.80
5.5.270.0030.05720.79
5.5.260.0170.07320.89
5.5.250.0130.07320.52
5.5.240.0200.03720.37
5.4.450.0200.05019.16
5.4.440.0930.05319.17
5.4.430.1030.05719.44
5.4.420.1100.05019.46
5.4.410.1200.07019.49
5.4.400.0230.05018.86
5.4.390.0230.05318.75
5.4.380.0270.04718.76
5.4.370.0170.05718.58
5.4.360.0130.05718.49
5.4.350.0230.05718.74
5.4.340.0300.05018.78
5.4.320.0100.07318.48
5.4.310.0200.06018.64
5.4.300.0200.06018.58
5.4.290.0230.05018.60
5.4.280.0170.05718.71
5.4.270.0230.05018.61
5.4.260.0230.05318.70
5.4.250.0300.05718.71
5.4.240.0200.05318.61
5.4.230.0230.05318.77
5.4.220.0230.06318.82
5.4.210.0200.05318.59
5.4.200.0230.04716.57
5.4.190.0230.05018.75
5.4.180.0300.04718.74
5.4.170.0170.06018.72
5.4.160.0270.04718.73
5.4.150.0230.05018.77
5.4.140.0270.04716.32
5.4.130.0230.06016.27
5.4.120.0330.04016.30
5.4.110.0130.06016.33
5.4.100.0200.05016.39
5.4.90.0330.04316.35
5.4.80.0300.04716.27
5.4.70.0330.04316.24
5.4.60.0270.05316.21
5.4.50.0130.05716.28
5.4.40.0270.04316.30
5.4.30.0230.05016.27
5.4.20.0270.05016.31
5.4.10.0230.05016.28
5.4.00.0300.04315.90
5.3.290.0230.05714.86
5.3.280.0270.04714.63
5.3.270.0270.05014.67
5.3.260.0300.05014.66
5.3.250.0200.06314.67
5.3.240.0230.05314.72
5.3.230.0200.05714.67
5.3.220.0270.05014.56
5.3.210.0230.05314.57
5.3.200.0270.05014.66
5.3.190.0270.05714.71
5.3.180.0330.04714.62
5.3.170.0230.05314.55
5.3.160.0230.05014.74
5.3.150.0130.08314.77
5.3.140.0230.05014.60
5.3.130.0230.06014.61
5.3.120.0200.06014.77
5.3.110.0270.05314.76
5.3.100.0170.05314.26
5.3.90.0270.04714.03
5.3.80.0200.05314.05
5.3.70.0170.08014.07
5.3.60.0230.05714.13
5.3.50.0230.05313.96
5.3.40.0200.06314.17
5.3.30.0200.05314.00
5.3.20.0230.04713.81
5.3.10.0130.05313.73
5.3.00.0230.05013.82
5.2.170.0130.04311.14
5.2.160.0130.04711.20
5.2.150.0130.04311.21
5.2.140.0270.03311.21
5.2.130.0170.04011.11
5.2.120.0130.04311.13
5.2.110.0100.04311.10
5.2.100.0200.03711.23
5.2.90.0230.03311.14
5.2.80.0170.04011.14
5.2.70.0230.03711.23
5.2.60.0200.04011.09
5.2.50.0170.04311.09
5.2.40.0000.05311.02
5.2.30.0100.04311.03
5.2.20.0170.03710.97
5.2.10.0170.03710.93
5.2.00.0070.04710.84
5.1.60.0130.03710.19
5.1.50.0100.03710.07
5.1.40.0130.0339.97
5.1.30.0170.03310.38
5.1.20.0100.04010.57
5.1.10.0130.03710.20
5.1.00.0130.03710.12
5.0.50.0170.0208.75
5.0.40.0070.0278.49
5.0.30.0100.0408.36
5.0.20.0070.0278.20
5.0.10.0130.0208.24
5.0.00.0100.0408.28
4.4.90.0100.0205.95
4.4.80.0070.0205.93
4.4.70.0100.0205.99
4.4.60.0130.0235.93
4.4.50.0100.0175.91
4.4.40.0100.0335.89
4.4.30.0070.0236.00
4.4.20.0030.0275.95
4.4.10.0070.0276.00
4.4.00.0030.0506.05
4.3.110.0030.0335.82
4.3.100.0130.0135.87
4.3.90.0100.0175.90
4.3.80.0070.0335.84
4.3.70.0070.0205.81
4.3.60.0100.0205.89
4.3.50.0100.0205.81
4.3.40.0100.0305.76
4.3.30.0000.0274.64
4.3.20.0100.0174.60
4.3.10.0030.0204.55
4.3.00.0100.0237.32

preferences:
55.69 ms | 401 KiB | 5 Q