3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<{$headtype} class="{$class}">{$text}</{$headtype}>'; $array['headtype'] = 'h1'; $array['class'] = 'classname'; $array['text'] = 'the title'; foreach ($array as $key => $value) { $html = str_replace('{$'.$key.'}', $value, $html); } echo $html;

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.4.120.0090.01120.72
8.4.110.0120.00822.16
8.4.100.0150.00718.91
8.4.90.0050.00418.91
8.4.80.0040.00720.37
8.4.70.0070.00917.90
8.4.60.0120.00918.59
8.4.50.0110.00917.63
8.4.40.0080.00019.38
8.4.30.0070.01119.83
8.4.20.0090.00919.48
8.4.10.0080.00819.40
8.3.250.0120.00718.81
8.3.240.0100.00920.75
8.3.230.0070.00416.45
8.3.220.0120.00718.77
8.3.210.0040.00418.48
8.3.200.0070.00116.63
8.3.190.0100.00816.93
8.3.180.0070.00816.64
8.3.170.0090.00616.48
8.3.160.0150.00416.61
8.3.150.0070.01117.12
8.3.140.0040.00417.14
8.3.130.0060.00318.51
8.3.120.0030.00620.63
8.3.110.0000.00718.43
8.3.100.0060.00918.43
8.3.90.0100.00726.77
8.3.80.0040.00716.38
8.3.70.0090.00616.58
8.3.60.0070.00716.50
8.3.50.0080.00617.37
8.3.40.0150.00018.82
8.3.30.0140.00018.70
8.3.20.0070.00020.29
8.3.10.0000.00821.72
8.3.00.0040.00421.73
8.2.290.0080.01020.30
8.2.280.0100.01020.52
8.2.270.0130.00616.61
8.2.260.0130.00719.09
8.2.250.0080.00018.66
8.2.240.0000.00917.13
8.2.230.0030.00620.94
8.2.220.0060.00324.06
8.2.210.0140.00426.77
8.2.200.0030.00616.75
8.2.190.0110.00716.63
8.2.180.0070.01125.92
8.2.170.0090.00918.95
8.2.160.0130.00022.96
8.2.150.0020.00525.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00019.66
8.2.110.0070.00420.90
8.2.100.0110.00018.34
8.2.90.0030.00619.25
8.2.80.0050.00317.97
8.2.70.0050.00317.75
8.2.60.0070.00017.93
8.2.50.0060.00318.22
8.2.40.0030.00622.27
8.2.30.0040.00419.19
8.2.20.0000.00718.00
8.2.10.0020.00518.06
8.2.00.0040.00418.04
8.1.330.0090.01022.09
8.1.320.0140.00516.16
8.1.310.0070.01116.79
8.1.300.0030.00618.36
8.1.290.0060.00330.84
8.1.280.0110.00725.92
8.1.270.0050.00323.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.76
8.1.230.0070.00420.37
8.1.220.0000.00817.79
8.1.210.0030.00518.77
8.1.200.0040.00417.35
8.1.190.0040.00417.47
8.1.180.0030.00518.10
8.1.170.0050.00318.66
8.1.160.0000.00818.81
8.1.150.0040.00420.11
8.1.140.0070.00317.45
8.1.130.0000.00818.95
8.1.120.0100.00017.46
8.1.110.0080.00017.46
8.1.100.0030.00417.41
8.1.90.0030.00517.30
8.1.80.0000.00717.32
8.1.70.0030.00317.33
8.1.60.0040.00417.64
8.1.50.0040.00417.54
8.1.40.0030.00617.50
8.1.30.0060.00317.55
8.1.20.0050.00317.62
8.1.10.0000.00817.46
8.1.00.0030.00617.40
8.0.300.0020.00519.21
8.0.290.0060.00316.75
8.0.280.0040.00418.38
8.0.270.0000.00918.55
8.0.260.0000.00818.36
8.0.250.0030.00316.95
8.0.240.0040.00416.96
8.0.230.0070.00016.89
8.0.220.0000.00716.89
8.0.210.0000.00716.90
8.0.200.0030.00316.95
8.0.190.0030.00516.95
8.0.180.0030.00316.93
8.0.170.0040.00416.95
8.0.160.0000.00716.93
8.0.150.0000.00716.91
8.0.140.0030.00716.89
8.0.130.0030.00313.36
8.0.120.0030.00516.93
8.0.110.0000.00816.87
8.0.100.0040.00416.92
8.0.90.0040.00416.88
8.0.80.0060.00916.92
8.0.70.0050.00316.73
8.0.60.0050.00316.73
8.0.50.0040.00416.71
8.0.30.0130.00517.14
8.0.20.0110.00917.40
8.0.10.0030.00516.88
8.0.00.0070.01016.57
7.4.330.0040.00015.55
7.4.320.0030.00316.51
7.4.300.0060.00016.53
7.4.290.0110.00016.64
7.4.280.0070.00016.60
7.4.270.0000.00716.63
7.4.260.0070.00016.41
7.4.250.0050.00316.36
7.4.240.0030.00316.42
7.4.230.0030.00316.61
7.4.220.0090.01616.42
7.4.210.0030.01216.51
7.4.200.0000.00716.42
7.4.160.0100.00616.56
7.4.150.0130.01017.40
7.4.140.0100.01217.86
7.4.130.0090.00916.39
7.4.120.0100.01016.65
7.4.110.0140.00416.50
7.4.100.0070.01016.52
7.4.90.0100.00616.46
7.4.80.0140.00819.39
7.4.70.0060.01216.60
7.4.60.0100.00716.50
7.4.50.0030.01216.55
7.4.40.0070.01416.60
7.4.30.0130.00316.55
7.4.00.0080.00614.98
7.3.330.0020.00213.25
7.3.320.0060.00013.27
7.3.310.0030.00316.26
7.3.300.0030.00316.44
7.3.290.0080.00816.40
7.3.280.0080.00816.29
7.3.270.0100.00617.40
7.3.260.0110.00616.38
7.3.250.0120.00416.54
7.3.240.0120.00716.31
7.3.230.0070.01016.62
7.3.210.0030.01616.64
7.3.200.0160.00016.67
7.3.190.0070.00716.67
7.3.180.0160.00016.29
7.3.170.0060.01016.34
7.3.160.0060.01016.44
7.3.10.0070.00516.66
7.3.00.0050.00716.49
7.2.330.0070.01016.81
7.2.320.0140.00316.75
7.2.310.0030.01816.75
7.2.300.0070.01116.72
7.2.290.0030.01416.68
7.2.130.0040.00916.91
7.2.120.0020.01316.96
7.2.110.0080.00816.91
7.2.100.0090.00416.93
7.2.90.0050.00616.76
7.2.80.0070.00516.70
7.2.70.0050.00816.87
7.2.60.0080.00816.92
7.2.50.0070.00716.91
7.2.40.0080.00516.83
7.2.30.0020.00916.94
7.2.20.0080.00616.90
7.2.10.0050.00716.85
7.2.00.0070.00516.92
7.1.250.0070.00415.66
7.1.200.0000.01515.75
7.1.120.0670.00416.98
7.1.110.0660.00916.16
7.1.100.0680.00716.39
7.1.90.0650.01615.98
7.1.80.0480.01215.90
7.1.70.1130.01015.32
7.1.60.0580.01033.24
7.1.50.0520.01633.03
7.1.40.0590.01532.68
7.1.30.0630.01332.44
7.1.20.0650.00732.79
7.1.10.0530.01014.68
7.1.00.0860.01014.91
7.0.250.0410.01015.68
7.0.240.0700.00616.12
7.0.230.0620.01115.57
7.0.220.0760.01315.66
7.0.210.0360.01614.79
7.0.200.0540.00714.85
7.0.190.0530.01014.75
7.0.180.0480.00714.66
7.0.170.0560.00714.54
7.0.160.0930.01014.38
7.0.150.0640.01214.37
7.0.140.0560.00714.57
7.0.130.0420.01314.52
7.0.120.0480.01014.85
7.0.110.0360.01114.49
7.0.100.0420.00914.68
7.0.90.0470.00614.65
7.0.80.0510.00714.71
7.0.70.0550.01014.56
7.0.60.0760.01014.25
7.0.50.0440.01314.61
7.0.40.0520.01414.70
7.0.30.0470.00314.83
7.0.20.0420.00714.73
7.0.10.0420.01214.50
7.0.00.0440.01014.61

preferences:
28.23 ms | 403 KiB | 5 Q