3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "I need to replace {X} and {Y}"; $X = 'something'; $Y = 'something else'; function parse($string) { $v = sprintf('%s%s%s%s%s%s%s', chr(71), chr(76), chr(79), chr(66), chr(65), chr(76), chr(83)); preg_match_all('/\{(.*?)\}/', $string, $matches); foreach ($matches[1] as $value) { $string = str_replace('{'.$value.'}', $v[${$value}], $string); } return $string; } echo parse($string);

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.40.0120.00319.00
8.3.30.0090.00618.69
8.3.20.0080.00019.07
8.3.10.0000.00818.89
8.3.00.0050.00319.63
8.2.170.0070.00722.96
8.2.160.0140.00319.13
8.2.150.0000.00924.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0020.00521.26
8.2.110.0040.00721.24
8.2.100.0070.00418.09
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0050.00317.93
8.2.50.0000.00818.03
8.2.40.0040.00419.85
8.2.30.0060.00318.07
8.2.20.0000.01117.89
8.2.10.0030.00517.83
8.2.00.0080.00017.89
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00321.37
8.1.230.0070.00417.89
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0030.00617.50
8.1.190.0000.00817.48
8.1.180.0000.00818.10
8.1.170.0050.00317.62
8.1.160.0070.00019.05
8.1.150.0040.00418.87
8.1.140.0040.00417.62
8.1.130.0040.00417.62
8.1.120.0000.00917.53
8.1.110.0070.00017.59
8.1.100.0030.00317.50
8.1.90.0050.00217.50
8.1.80.0060.00317.63
8.1.70.0040.00417.62
8.1.60.0040.00417.70
8.1.50.0000.00817.68
8.1.40.0040.00417.67
8.1.30.0040.00417.83
8.1.20.0040.00417.76
8.1.10.0040.00417.75
8.1.00.0000.00917.61
8.0.300.0050.00218.77
8.0.290.0030.00616.75
8.0.280.0080.00018.59
8.0.270.0040.00417.29
8.0.260.0060.00017.05
8.0.250.0040.00417.09
8.0.240.0000.00717.14
8.0.230.0060.00317.21
8.0.220.0030.00317.13
8.0.210.0030.00517.10
8.0.200.0040.00417.19
8.0.190.0070.00017.09
8.0.180.0070.00017.17
8.0.170.0040.00417.20
8.0.160.0070.00017.20
8.0.150.0000.00917.16
8.0.140.0000.00817.04
8.0.130.0060.00013.59
8.0.120.0060.00317.16
8.0.110.0030.00416.93
8.0.100.0040.00417.05
8.0.90.0040.00417.02
8.0.80.0120.00917.18
8.0.70.0080.00017.12
8.0.60.0030.00616.99
8.0.50.0030.00616.98
8.0.30.0100.00717.41
8.0.20.0150.00717.34
8.0.10.0040.00417.09
8.0.00.0060.01417.06
7.4.330.0030.00313.11
7.4.320.0000.00716.80
7.4.300.0060.00016.74
7.4.290.0000.00916.75
7.4.280.0100.00016.75
7.4.270.0070.00016.85
7.4.260.0050.00013.48
7.4.250.0040.00416.77
7.4.240.0000.00716.89
7.4.230.0030.00316.92
7.4.220.0060.01316.58
7.4.210.0070.01316.68
7.4.200.0040.00416.71
7.4.190.0040.00416.96
7.4.160.0090.00616.77
7.4.150.0120.01216.59
7.4.140.0150.00417.86
7.4.130.0070.02116.62
7.4.120.0060.01216.79
7.4.110.0190.00316.78
7.4.100.0000.01916.74
7.4.90.0110.01116.83
7.4.80.0150.00919.39
7.4.70.0120.00616.81
7.4.60.0060.00916.71
7.4.50.0080.00416.71
7.4.40.0060.00916.82
7.4.30.0080.00816.83
7.4.00.0090.00715.17
7.3.330.0060.00013.43
7.3.320.0030.00313.56
7.3.310.0000.00716.47
7.3.300.0060.00016.63
7.3.290.0060.00816.56
7.3.280.0070.00816.59
7.3.270.0110.00617.02
7.3.260.0080.00916.59
7.3.240.0090.01316.79
7.3.230.0110.01516.80
7.3.210.0080.00816.66
7.3.200.0090.00916.84
7.3.190.0070.01016.84
7.3.180.0070.01016.61
7.3.170.0130.01216.67
7.3.160.0080.00816.88
7.3.120.0080.00915.10
7.3.110.0030.01614.91
7.3.100.0090.01215.06
7.3.90.0130.00015.11
7.3.80.0100.00715.24
7.3.70.0070.00315.13
7.3.60.0060.00915.11
7.3.50.0030.00615.07
7.3.40.0030.00915.13
7.3.30.0060.00315.09
7.3.20.0030.01216.96
7.3.10.0100.00716.78
7.3.00.0040.00416.87
7.2.330.0060.01516.81
7.2.320.0030.01716.73
7.2.310.0120.01116.95
7.2.300.0060.01116.82
7.2.290.0100.00716.86
7.2.250.0130.00615.20
7.2.240.0120.00615.24
7.2.230.0080.00615.35
7.2.220.0100.00615.10
7.2.210.0040.00715.20
7.2.200.0040.00415.23
7.2.190.0000.01315.42
7.2.180.0070.00715.31
7.2.170.0000.00915.02
7.2.160.0050.00515.33
7.2.150.0150.00017.09
7.2.140.0000.01717.25
7.2.130.0040.00817.24
7.2.120.0030.01317.16
7.2.110.0030.01216.96
7.2.100.0150.00416.85
7.2.90.0150.00016.96
7.2.80.0090.00617.21
7.2.70.0090.00617.17
7.2.60.0000.01617.25
7.2.50.0070.00717.11
7.2.40.0070.00717.28
7.2.30.0090.00917.38
7.2.20.0060.01217.30
7.2.10.0090.00916.99
7.2.00.0090.00118.48
7.1.330.0060.01216.13
7.1.320.0060.00316.09
7.1.310.0030.00916.03
7.1.300.0030.00615.99
7.1.290.0040.00916.14
7.1.280.0040.00415.90
7.1.270.0070.00715.86
7.1.260.0060.00615.71
7.1.250.0000.01315.77
7.1.240.0060.01016.16
7.1.230.0100.00315.92
7.1.220.0100.01015.96
7.1.210.0060.01215.71
7.1.200.0050.00816.00
7.1.190.0060.00916.06
7.1.180.0070.00716.10
7.1.170.0030.00715.92
7.1.160.0110.00415.96
7.1.150.0050.00515.63
7.1.140.0040.01116.01
7.1.130.0110.00415.75
7.1.120.0070.00415.75
7.1.110.0070.00716.09
7.1.100.0170.00517.23
7.1.90.0050.00316.20
7.1.80.0000.01216.01
7.1.70.0050.00816.75
7.1.60.0080.01217.52
7.1.50.0110.00925.68
7.1.40.0000.00815.89
7.1.30.0030.00615.98
7.1.20.0070.00716.17
7.1.10.0030.01015.93
7.1.00.0050.02319.27
7.0.330.0100.00315.69
7.0.320.0100.00715.28
7.0.310.0040.00415.32
7.0.300.0030.01015.30
7.0.290.0030.01015.79
7.0.280.0120.00015.41
7.0.270.0030.01315.45
7.0.260.0060.00315.17
7.0.250.0030.00615.69
7.0.240.0070.00415.66
7.0.230.0030.01315.55
7.0.220.0040.00415.36
7.0.210.0070.01015.68
7.0.200.0050.00716.03
7.0.190.0040.00815.42
7.0.180.0070.00315.41
7.0.170.0070.00715.45
7.0.160.0050.00315.59
7.0.150.0000.01315.64
7.0.140.0070.03718.84
7.0.130.0040.00415.67
7.0.120.0030.03818.89
7.0.110.0030.01015.32
7.0.100.0030.00915.59
7.0.90.0070.00715.56
7.0.80.0030.00715.50
7.0.70.0100.00315.57
7.0.60.0100.04718.66
7.0.50.0080.03016.71
7.0.40.0030.04716.82
7.0.30.0030.04416.91
7.0.20.0050.04516.79
7.0.10.0050.04316.97
7.0.00.0090.02316.91
5.6.400.0120.00014.66
5.6.390.0100.00313.98
5.6.380.0070.00714.23
5.6.370.0030.00914.56
5.6.360.0030.01314.61
5.6.350.0030.01214.30
5.6.340.0100.00314.23
5.6.330.0080.00314.37
5.6.320.0090.00014.52
5.6.310.0090.01214.68
5.6.300.0030.00714.23
5.6.290.0030.00614.66
5.6.280.0060.03717.67
5.6.270.0000.00914.23
5.6.260.0130.00314.36
5.6.250.0000.01314.30
5.6.240.0060.00614.27
5.6.230.0070.00714.42
5.6.220.0110.00614.57
5.6.210.0070.03917.46
5.6.200.0050.04616.18
5.6.190.0030.04617.50
5.6.180.0030.03417.46
5.6.170.0110.03717.54
5.6.160.0060.03717.32
5.6.150.0020.03017.28
5.6.140.0050.04417.30
5.6.130.0070.04317.27
5.6.120.0030.03017.36
5.6.110.0030.02717.31
5.6.100.0040.03817.38
5.6.90.0070.04317.30
5.6.80.0080.04216.92
5.6.70.0000.03316.88
5.6.60.0080.03216.92
5.6.50.0020.04917.07
5.6.40.0020.02617.19
5.6.30.0050.02516.90
5.6.20.0030.04517.12
5.6.10.0090.03017.20
5.6.00.0050.04617.16
5.5.380.0080.00414.05
5.5.370.0100.00614.57
5.5.360.0000.01014.20
5.5.350.0100.04017.26
5.5.340.0090.04016.19
5.5.330.0050.04317.18
5.5.320.0090.04017.27
5.5.310.0040.04417.17
5.5.300.0030.02317.14
5.5.290.0050.04617.35
5.5.280.0020.03117.15
5.5.270.0050.04717.32
5.5.260.0000.04817.33
5.5.250.0030.02717.01
5.5.240.0030.04317.03
5.5.230.0090.03216.99
5.5.220.0050.03016.97
5.5.210.0030.03216.89
5.5.200.0070.02216.99
5.5.190.0030.02716.68
5.5.180.0020.03116.87
5.5.170.0040.01214.30
5.5.160.0020.04716.90
5.5.150.0050.03416.89
5.5.140.0170.02216.88
5.5.130.0020.03616.70
5.5.120.0080.04116.88
5.5.110.0050.04016.76
5.5.100.0070.03516.79
5.5.90.0050.02416.64
5.5.80.0030.02816.79
5.5.70.0050.04316.83
5.5.60.0050.04116.96
5.5.50.0040.03416.89
5.5.40.0070.02316.74
5.5.30.0030.04216.73
5.5.20.0050.04416.90
5.5.10.0030.03116.64
5.5.00.0050.04016.71
5.4.450.0130.03316.00
5.4.440.0070.02716.08
5.4.430.0070.03916.08
5.4.420.0060.02115.97
5.4.410.0050.04016.04
5.4.400.0030.03515.81
5.4.390.0060.02015.82
5.4.380.0050.03715.92
5.4.370.0000.02515.91
5.4.360.0030.04015.92
5.4.350.0050.01915.92
5.4.340.0020.02815.92
5.4.330.0060.00612.68
5.4.320.0030.02615.88
5.4.310.0080.03715.96
5.4.300.0050.03815.90
5.4.290.0030.02315.92
5.4.280.0050.04315.96
5.4.270.0050.03715.94
5.4.260.0010.03415.92
5.4.250.0020.04515.78
5.4.240.0040.02415.88
5.4.230.0050.03615.90
5.4.220.0030.02815.91
5.4.210.0050.02015.94
5.4.200.0030.04115.77
5.4.190.0050.04215.89
5.4.180.0070.03315.76
5.4.170.0030.03015.90
5.4.160.0030.04215.91
5.4.150.0020.02815.79
5.4.140.0050.03814.50
5.4.130.0010.03814.52
5.4.120.0030.03914.57
5.4.110.0030.04014.51
5.4.100.0080.02014.58
5.4.90.0130.01314.60
5.4.80.0030.03514.55
5.4.70.0070.02714.70
5.4.60.0110.01814.54
5.4.50.0120.02014.58
5.4.40.0060.03714.56
5.4.30.0020.04114.53
5.4.20.0020.03714.50
5.4.10.0030.03114.55
5.4.00.0050.02214.23
5.3.290.0060.01813.68
5.3.280.0080.02713.72
5.3.270.0030.03813.59
5.3.260.0050.04013.65
5.3.250.0050.02813.67
5.3.240.0020.04313.64
5.3.230.0020.03713.67
5.3.220.0060.02313.57
5.3.210.0080.03613.64
5.3.200.0050.04013.66
5.3.190.0100.02513.64
5.3.180.0050.04013.63
5.3.170.0030.04113.70
5.3.160.0010.02613.62
5.3.150.0050.02213.63
5.3.140.0030.04113.63
5.3.130.0050.02213.69
5.3.120.0050.04013.62
5.3.110.0100.03513.63
5.3.100.0060.02213.36
5.3.90.0020.03813.36
5.3.80.0030.02613.35
5.3.70.0030.04213.38
5.3.60.0020.03713.36
5.3.50.0060.02813.36
5.3.40.0020.04113.26
5.3.30.0030.04113.38
5.3.20.0010.02313.26
5.3.10.0060.03513.26
5.3.00.0040.02213.26
5.2.170.0000.04313.84
5.2.160.0100.03313.84
5.2.150.0030.06313.84
5.2.140.0070.03013.84
5.2.130.0070.04313.84
5.2.120.0000.03713.84
5.2.110.0000.06713.84
5.2.100.0030.06313.84
5.2.90.0000.06313.84
5.2.80.0100.05313.84
5.2.70.0030.06013.84
5.2.60.0000.05313.84
5.2.50.0000.06013.84
5.2.40.0030.06013.84
5.2.30.0070.04313.84
5.2.20.0070.06013.84
5.2.10.0030.04013.84
5.2.00.0000.03013.84
5.1.60.0000.02713.84
5.1.50.0000.05713.84
5.1.40.0030.03313.84
5.1.30.0030.06013.84
5.1.20.0000.05313.84
5.1.10.0070.03713.84
5.1.00.0070.02713.84
5.0.50.0000.04713.84
5.0.40.0030.04013.84
5.0.30.0070.06313.84
5.0.20.0030.04013.84
5.0.10.0000.04713.84
5.0.00.0030.06313.84
4.4.90.0030.03013.84
4.4.80.0000.03713.84
4.4.70.0030.02313.84
4.4.60.0070.03013.84
4.4.50.0000.02713.84
4.4.40.0000.05313.84
4.4.30.0000.02713.84
4.4.20.0030.03313.84
4.4.10.0000.02013.84
4.4.00.0000.05313.84
4.3.110.0000.03313.84
4.3.100.0030.03013.84
4.3.90.0000.03313.84
4.3.80.0000.05713.84
4.3.70.0070.03013.84
4.3.60.0000.03013.84
4.3.50.0000.03713.84
4.3.40.0030.03313.84
4.3.30.0030.02713.84
4.3.20.0000.03713.84
4.3.10.0000.03313.84
4.3.00.0030.03713.84

preferences:
55.38 ms | 400 KiB | 5 Q