3v4l.org

run code in 300+ PHP versions simultaneously
<?php $clasa = 'HHH'; $length = '100'; $width = 200; $depth = 300; $string1 = '{{clasa}}{{lenght}}{{width}}'; $string2 = '{{clasa}}{{lenght}}{{depth}}'; $string3 = '{{clasa}}_word{{lenght}},anything{{depth}}'; //$new1 = preg_replace('/{{([a-zA-Z\_\-]*?)}}/', ${'"$1"'}, $string1); $new1 = preg_replace_callback("/{{([a-zA-Z\_\-]*?)}}/", function($m){ global ${$m["1"]}; return ${$m["1"]}; }, $string1); echo $new1;

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.0100.01017.00
8.3.50.0170.00321.21
8.3.40.0040.01118.93
8.3.30.0060.00918.87
8.3.20.0090.00019.07
8.3.10.0000.00821.95
8.3.00.0110.00720.88
8.2.180.0040.01118.51
8.2.170.0120.00322.96
8.2.160.0120.00319.28
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00421.16
8.2.120.0050.00226.35
8.2.110.0060.00321.06
8.2.100.0100.01017.89
8.2.90.0040.00419.39
8.2.80.0000.00917.97
8.2.70.0080.00017.75
8.2.60.0040.00718.05
8.2.50.0090.00018.10
8.2.40.0000.00822.39
8.2.30.0000.00720.70
8.2.20.0060.00617.88
8.2.10.0000.00718.07
8.2.00.0040.00818.04
8.1.280.0070.00725.92
8.1.270.0050.00223.96
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0090.00022.55
8.1.230.0070.00417.83
8.1.220.0050.00317.79
8.1.210.0030.00518.77
8.1.200.0060.00317.48
8.1.190.0080.00017.48
8.1.180.0030.00618.10
8.1.170.0080.00018.68
8.1.160.0000.00819.11
8.1.150.0000.00718.98
8.1.140.0000.00719.61
8.1.130.0000.00717.76
8.1.120.0030.00317.61
8.1.110.0050.00317.57
8.1.100.0070.00317.51
8.1.90.0060.00317.59
8.1.80.0020.00517.61
8.1.70.0030.00317.60
8.1.60.0030.00517.75
8.1.50.0030.00617.59
8.1.40.0000.00817.64
8.1.30.0000.00817.76
8.1.20.0040.00417.81
8.1.10.0040.00417.49
8.1.00.0060.00317.68
8.0.300.0000.00718.77
8.0.290.0040.00417.00
8.0.280.0000.00718.49
8.0.270.0000.00717.28
8.0.260.0040.00417.20
8.0.250.0030.00317.13
8.0.240.0070.00017.17
8.0.230.0030.00317.03
8.0.220.0040.00417.06
8.0.210.0030.00317.02
8.0.200.0030.00317.09
8.0.190.0040.00417.14
8.0.180.0040.00417.06
8.0.170.0000.00817.01
8.0.160.0070.00017.06
8.0.150.0030.00416.90
8.0.140.0000.00716.96
8.0.130.0030.00313.44
8.0.120.0040.00416.93
8.0.110.0040.00417.04
8.0.100.0040.00416.97
8.0.90.0040.00417.07
8.0.80.0100.00617.00
8.0.70.0000.00716.88
8.0.60.0040.00416.93
8.0.50.0050.00316.99
8.0.30.0110.00717.38
8.0.20.0120.00717.45
8.0.10.0040.00417.17
8.0.00.0120.00816.76
7.4.330.0050.00015.09
7.4.320.0000.00616.75
7.4.300.0060.00016.70
7.4.290.0000.00716.73
7.4.280.0070.00016.77
7.4.270.0000.00716.83
7.4.260.0040.00416.73
7.4.250.0060.00316.64
7.4.240.0000.00816.66
7.4.230.0070.00016.71
7.4.220.0040.01516.94
7.4.210.0080.00616.82
7.4.200.0030.00416.92
7.4.160.0100.01016.83
7.4.150.0170.00017.40
7.4.140.0100.01117.86
7.4.130.0140.00316.75
7.4.120.0110.00816.79
7.4.110.0090.00916.81
7.4.100.0060.01216.93
7.4.90.0130.00316.68
7.4.80.0070.01419.39
7.4.70.0090.00616.59
7.4.60.0140.00316.52
7.4.50.0070.01116.55
7.4.40.0130.01116.70
7.4.30.0030.01416.77
7.4.00.0030.01315.15
7.3.330.0000.00513.55
7.3.320.0060.00013.51
7.3.310.0000.00716.58
7.3.300.0030.00316.64
7.3.290.0090.00816.47
7.3.280.0100.00816.47
7.3.270.0100.00717.40
7.3.260.0170.00716.70
7.3.250.0120.00816.70
7.3.240.0110.01316.64
7.3.230.0160.00616.75
7.3.210.0000.01716.69
7.3.200.0100.00616.83
7.3.190.0090.01216.68
7.3.180.0060.00916.53
7.3.170.0150.00316.50
7.3.160.0190.00616.60
7.3.10.0090.00316.86
7.3.00.0040.01216.55
7.2.330.0140.00416.93
7.2.320.0090.00916.80
7.2.310.0030.01417.02
7.2.300.0100.00716.70
7.2.290.0100.00716.68
7.2.130.0110.00317.12
7.2.120.0000.01617.30
7.2.110.0120.00016.98
7.2.100.0110.00317.20
7.2.90.0090.00617.14
7.2.80.0120.00316.95
7.2.70.0000.01717.01
7.2.60.0070.00717.04
7.2.50.0090.00617.14
7.2.40.0090.00317.25
7.2.30.0090.00616.96
7.2.20.0000.01317.00
7.2.10.0040.01117.11
7.2.00.0040.01018.47
7.1.250.0040.00816.14
7.1.100.0030.00618.46
7.1.70.0070.00017.32
7.1.60.0090.00619.24
7.1.00.0000.07722.30
7.0.200.0860.00714.86
7.0.60.4700.04719.93
7.0.50.0270.05020.41
7.0.40.0400.05320.33
7.0.30.0500.07320.41
7.0.20.0470.04720.19
7.0.10.0470.05720.18
7.0.00.0170.08020.42
5.6.280.0070.07021.11
5.6.210.0100.08020.71
5.6.200.0170.06021.16
5.6.190.0330.05721.14
5.6.180.0600.04021.04
5.6.170.0400.05321.04
5.6.160.0070.06721.13
5.6.150.0030.07321.10
5.6.140.0470.06721.12
5.6.130.0130.06021.09
5.6.120.0130.05721.10
5.6.110.0170.06021.14
5.6.100.0130.06721.14
5.6.90.0200.07021.14
5.6.80.0300.05720.49
5.6.70.0330.05320.49
5.6.60.0370.05320.50
5.6.50.0570.07020.33
5.6.40.0400.05320.52
5.6.30.0300.05720.30
5.6.20.0070.06320.45
5.6.10.0570.05320.41
5.6.00.0400.05320.40
5.5.350.0200.03020.41
5.5.340.0230.06320.95
5.5.330.0330.07320.89
5.5.320.0400.05320.85
5.5.310.0330.06720.88
5.5.300.0370.07320.87
5.5.290.0170.06320.84
5.5.280.0130.05720.83
5.5.270.0070.06720.87
5.5.260.0470.04720.88
5.5.250.0300.06020.64
5.5.240.0400.04320.38
5.5.230.0500.05020.26
5.5.220.0470.06720.24
5.5.210.0400.05020.24
5.5.200.0500.07020.22
5.5.190.0200.06720.29
5.5.180.0100.05720.05
5.5.160.0370.05020.14
5.5.150.0400.04720.14
5.5.140.0400.04720.28
5.5.130.0400.04320.18
5.5.120.0470.05320.28
5.5.110.0470.05320.38
5.5.100.0330.06320.20
5.5.90.0230.06020.12
5.5.80.0400.04320.16
5.5.70.0400.04720.15
5.5.60.0430.05020.14
5.5.50.0400.05020.25
5.5.40.0430.04020.06
5.5.30.0400.05020.10
5.5.20.0230.06320.11
5.5.10.0370.06019.96
5.5.00.0330.05320.15

preferences:
62.14 ms | 401 KiB | 5 Q