3v4l.org

run code in 300+ PHP versions simultaneously
<?php class system_tags { function __call($name, $params) { return 'TAG "' . $name . '" WAS HERE'; } } class App { function run() { // Prerequisites. $system_tags = new system_tags(); $core = new \stdClass(); $core->tags = array( 'hello' => 'HELLO!', 'world' => 'WORLD!', ); $this->template = 'Blah blah {hello} blah blah {world}.'; $this->withStrReplace($core, $system_tags); $this->template = 'Blah blah {hello} blah blah {world}.'; $this->withRegexReplaceCallback($core, $system_tags); } function withStrReplace($core, $system_tags) { foreach($core->tags as $tag_name => $tag_method) { $this->template = str_replace( '{' . $tag_name . '}', $system_tags->{$tag_method}(), $this->template ); } } function withRegexReplaceCallback($core, $system_tags) { $callback = static function ($matches) use (& $tag_method, $system_tags) { 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 ); } echo $this->template . "\n<br>"; } }

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.0120.00616.50
8.3.50.0080.01122.01
8.3.40.0100.00718.75
8.3.30.0040.01118.96
8.3.20.0050.00220.32
8.3.10.0040.00421.91
8.3.00.0040.00419.25
8.2.180.0150.00618.20
8.2.170.0130.00722.96
8.2.160.0130.00019.20
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.64
8.2.110.0120.00420.32
8.2.100.0040.00917.38
8.2.90.0040.00419.09
8.2.80.0050.00317.97
8.2.70.0070.00317.38
8.2.60.0050.00317.90
8.2.50.0090.00018.07
8.2.40.0000.00918.22
8.2.30.0040.00417.95
8.2.20.0000.00817.57
8.2.10.0050.00317.82
8.2.00.0030.00517.55
8.1.280.0070.01125.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00317.64
8.1.230.0090.00318.91
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0040.00417.23
8.1.190.0080.00017.23
8.1.180.0040.00418.10
8.1.170.0050.00320.15
8.1.160.0040.00421.96
8.1.150.0040.00418.77
8.1.140.0000.00717.30
8.1.130.0070.00017.77
8.1.120.0040.00417.41
8.1.110.0030.00617.34
8.1.100.0040.00417.34
8.1.90.0030.00517.21
8.1.80.0000.00717.36
8.1.70.0070.00017.23
8.1.60.0040.00417.48
8.1.50.0050.00317.46
8.1.40.0000.00817.29
8.1.30.0030.00517.50
8.1.20.0040.00417.46
8.1.10.0040.00417.39
8.1.00.0000.00817.33
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0000.00718.23
8.0.270.0000.00817.09
8.0.260.0030.00317.18
8.0.250.0030.00316.83
8.0.240.0030.00316.86
8.0.230.0030.00516.77
8.0.220.0000.00716.74
8.0.210.0030.00316.65
8.0.200.0000.00716.80
8.0.190.0040.00416.69
8.0.180.0040.00416.73
8.0.170.0030.00616.84
8.0.160.0030.00616.77
8.0.150.0070.00016.72
8.0.140.0040.00416.64
8.0.130.0000.00713.18
8.0.120.0040.00416.69
8.0.110.0040.00416.70
8.0.100.0000.00716.75
8.0.90.0030.00516.75
8.0.80.0100.01016.77
8.0.70.0050.00216.89
8.0.60.0070.00016.71
8.0.50.0040.00416.76
8.0.30.0140.00716.85
8.0.20.0140.00917.40
8.0.10.0020.00516.92
8.0.00.0090.00816.60
7.4.330.0000.00515.03
7.4.320.0080.00016.39
7.4.300.0060.00016.49
7.4.290.0070.00016.49
7.4.280.0050.00216.32
7.4.270.0030.00316.41
7.4.260.0000.00716.44
7.4.250.0000.00816.46
7.4.240.0040.00416.48
7.4.230.0030.00316.23
7.4.220.0100.00716.49
7.4.210.0030.01216.43
7.4.200.0000.00716.36
7.4.160.0100.01316.54
7.4.150.0070.01717.40
7.4.140.0110.00817.86
7.4.130.0140.00516.32
7.4.120.0100.00816.55
7.4.110.0130.01016.36
7.4.100.0120.00616.29
7.4.90.0150.00616.50
7.4.80.0080.00919.39
7.4.70.0110.00616.45
7.4.60.0150.00316.30
7.4.50.0030.00616.42
7.4.40.0100.00716.30
7.4.30.0110.00716.44
7.4.00.0060.00914.65
7.3.330.0030.00313.13
7.3.320.0070.00712.99
7.3.310.0000.00716.09
7.3.300.0050.00216.08
7.3.290.0030.01216.17
7.3.280.0130.00716.17
7.3.270.0160.00317.40
7.3.260.0170.00716.32
7.3.250.0080.00916.32
7.3.240.0070.01416.41
7.3.230.0090.00916.39
7.3.210.0130.00616.15
7.3.200.0100.00719.39
7.3.190.0130.00316.53
7.3.180.0120.00316.37
7.3.170.0090.00616.50
7.3.160.0080.00916.16
7.3.10.0030.01016.61
7.3.00.0030.00616.54
7.2.330.0060.01316.31
7.2.320.0140.00716.49
7.2.310.0100.00716.54
7.2.300.0090.00916.53
7.2.290.0100.01016.42
7.2.130.0060.00916.61
7.2.120.0060.00616.57
7.2.110.0130.00716.64
7.2.100.0180.00016.56
7.2.90.0080.00816.84
7.2.80.0060.00616.89
7.2.70.0140.00716.32
7.2.60.0020.01416.68
7.2.50.0180.00316.55
7.2.40.0270.00316.86
7.2.30.0210.00716.37
7.2.20.0100.01016.82
7.2.10.0170.00616.77
7.2.00.0090.00918.00
7.1.250.0140.00015.41
7.1.200.0090.00015.55
7.1.100.0040.01218.13
7.1.70.0080.00016.98
7.1.60.0040.01419.50
7.1.50.0110.01116.53
7.1.00.0000.08022.28
7.0.200.0160.00314.92
7.0.140.0070.07321.90
7.0.60.0100.07319.89
7.0.50.0000.04317.88
7.0.40.0070.04020.14
7.0.30.0270.05720.34
7.0.20.0330.06720.15
7.0.10.0370.06020.23
7.0.00.0130.07320.23
5.6.280.0030.07320.88
5.6.210.0100.07720.72
5.6.200.0100.08018.13
5.6.190.0030.05320.55
5.6.180.0330.07320.43
5.6.170.0370.08720.48
5.6.160.0070.04720.48
5.6.150.0030.03718.18
5.6.140.0030.05718.17
5.6.130.0130.07718.20
5.6.120.0130.04021.11
5.6.110.0000.07321.13
5.6.100.0030.08720.99
5.6.90.0100.05020.98
5.6.80.0070.06720.50
5.6.70.0270.06720.43
5.5.350.0130.07720.46
5.5.340.0030.04718.02
5.5.330.0030.04320.27
5.5.320.0070.06020.32
5.5.310.0270.07720.27
5.5.300.0070.07317.93
5.5.290.0070.08018.04
5.5.280.0130.07720.82
5.5.270.0030.07020.88
5.5.260.0070.08020.66
5.5.250.0100.07720.80
5.5.240.0130.06020.30
5.4.450.0670.06019.56
5.4.440.0000.06719.48
5.4.430.0870.05719.47
5.4.420.1200.05019.46
5.4.410.1100.06319.35
5.4.400.1200.06718.63
5.4.390.0900.06018.62
5.4.380.0970.05318.73
5.4.370.1070.04718.76
5.4.360.1030.05018.81
5.4.350.0800.06018.62
5.4.340.1030.05018.84
5.4.320.1030.07018.74
5.4.310.0970.05018.75
5.4.300.0900.07018.80
5.4.290.1070.05718.75
5.4.280.0970.05018.73
5.4.270.0970.05318.61
5.4.260.1070.05318.67
5.4.250.1030.05718.50
5.4.240.1000.05318.63
5.4.230.1000.06018.71
5.4.220.0930.06018.79
5.4.210.0970.05318.76
5.4.200.1130.05016.71
5.4.190.0970.06018.70
5.4.180.0870.05718.79
5.4.170.0970.06018.70
5.4.160.1030.06018.78
5.4.150.1000.05018.55
5.4.140.0870.05716.29
5.4.130.1100.06716.30
5.4.120.1070.06316.29
5.4.110.0830.05016.45
5.4.100.0900.06016.43
5.4.90.1000.04716.45
5.4.80.1000.04316.28
5.4.70.0970.04716.28
5.4.60.0930.05716.26
5.4.50.0970.04716.31
5.4.40.1030.05316.30
5.4.30.0900.05316.22
5.4.20.0970.05316.21
5.4.10.1070.04716.35
5.4.00.1000.04715.72
5.3.290.0970.06714.86
5.3.280.0870.05014.81
5.3.270.0870.05714.80
5.3.260.0870.06314.60
5.3.250.1000.05014.80
5.3.240.1030.05014.67
5.3.230.1000.05714.67
5.3.220.0900.06014.67
5.3.210.1030.05314.59
5.3.200.0930.05014.68
5.3.190.1000.06714.68
5.3.180.0970.06314.57
5.3.170.0870.05314.74
5.3.160.0970.04714.59
5.3.150.0930.05314.79
5.3.140.1000.04714.61
5.3.130.0900.05314.67
5.3.120.1000.07014.59
5.3.110.1170.06314.77
5.3.100.1100.07314.09
5.3.90.0930.05314.08
5.3.80.0930.05014.09
5.3.70.0930.05014.16
5.3.60.0900.05714.13
5.3.50.0930.05314.01
5.3.40.1200.06714.00
5.3.30.1070.03713.93
5.3.20.0900.05313.84
5.3.10.1000.04313.80
5.3.00.0830.05713.79
5.2.170.0770.04311.26
5.2.160.0800.04311.23
5.2.150.0830.03711.19
5.2.140.0700.05011.38
5.2.130.0770.04311.16
5.2.120.0870.03311.12
5.2.110.0730.04711.12
5.2.100.0570.04011.14
5.2.90.0100.04311.32
5.2.80.0070.05011.11
5.2.70.0070.06311.23
5.2.60.0130.04011.19
5.2.50.0130.04311.23
5.2.40.0030.04711.21
5.2.30.0100.04311.20
5.2.20.0030.04711.15
5.2.10.0100.04011.10
5.2.00.0070.04310.77
5.1.60.0100.03310.04
5.1.50.0070.03710.19
5.1.40.0100.04010.04
5.1.30.0170.03010.37
5.1.20.0130.03710.47
5.1.10.0100.03710.29
5.1.00.0130.03310.18
5.0.50.0100.0278.64
5.0.40.0070.0278.46
5.0.30.0130.0378.38
5.0.20.0070.0308.30
5.0.10.0100.0278.20
5.0.00.0100.0438.29
4.4.90.0030.0276.02
4.4.80.0030.0335.93
4.4.70.0070.0205.90
4.4.60.0070.0236.03
4.4.50.0030.0235.91
4.4.40.0030.0375.92
4.4.30.0030.0236.03
4.4.20.0100.0205.96
4.4.10.0070.0275.98
4.4.00.0000.0406.00
4.3.110.0330.0235.93
4.3.100.0130.0235.84
4.3.90.0100.0175.81
4.3.80.0170.0235.81
4.3.70.0100.0335.79
4.3.60.0070.0205.80
4.3.50.0100.0205.84
4.3.40.0100.0305.76
4.3.30.0030.0234.68
4.3.20.0100.0174.61
4.3.10.0030.0234.60
4.3.00.0100.0237.32

preferences:
42.72 ms | 401 KiB | 5 Q