3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseDbString(string $value = 'Looking for a good {{ $pippo }}'){ $pippo='Pizza'; return preg_replace_callback('/{{(.*?)}}/', function($res) use ($pippo) { return "${trim($res[1])}"; // $val=${trim($res[1])}; Returns "Undefined variable: $pippo" $val=${trim($res[1])}; // Returns "Looking for a good Pizza" return isset($val) ? $val : $res[0]; },$value); } var_dump(parseDbString());

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.0140.00418.67
8.3.50.0110.00418.49
8.3.40.0110.00418.93
8.3.30.0100.01019.09
8.3.20.0070.00019.10
8.3.10.0030.00621.69
8.3.00.0030.00520.69
8.2.180.0090.00618.91
8.2.170.0110.00422.96
8.2.160.0110.00421.05
8.2.150.0030.00524.18
8.2.140.0060.00324.66
8.2.130.0040.00419.95
8.2.120.0040.00426.35
8.2.110.0070.00421.30
8.2.100.0090.00317.97
8.2.90.0000.00817.88
8.2.80.0050.00317.97
8.2.70.0050.00318.16
8.2.60.0040.00418.04
8.2.50.0050.00318.10
8.2.40.0040.00419.46
8.2.30.0050.00219.23
8.2.20.0000.00818.07
8.2.10.0040.00418.22
8.2.00.0030.00617.86
8.1.280.0120.00925.92
8.1.270.0050.00318.86
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00622.54
8.1.230.0030.00722.25
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0080.00317.48
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0060.00318.73
8.1.160.0000.00719.01
8.1.150.0030.00518.82
8.1.140.0000.00822.18
8.1.130.0040.00420.09
8.1.120.0000.00717.65
8.1.110.0080.00017.50
8.1.100.0020.00517.63
8.1.90.0040.00417.51
8.1.80.0080.00017.64
8.1.70.0040.00417.51
8.1.60.0050.00317.71
8.1.50.0000.00917.57
8.1.40.0000.00817.65
8.1.30.0000.00817.82
8.1.20.0050.00217.75
8.1.10.0000.00917.73
8.1.00.0040.00417.71
8.0.300.0060.00318.77
8.0.290.0000.00816.88
8.0.280.0030.00418.44
8.0.270.0080.00017.29
8.0.260.0030.00318.39
8.0.250.0070.00017.18
8.0.240.0060.00317.18
8.0.230.0000.00717.13
8.0.220.0060.00317.14
8.0.210.0030.00317.04
8.0.200.0040.00417.20
8.0.190.0030.00317.05
8.0.180.0040.00417.12
8.0.170.0050.00317.02
8.0.160.0070.00017.04
8.0.150.0040.00416.93
8.0.140.0070.00017.02
8.0.130.0030.00313.49
8.0.120.0060.00316.95
8.0.110.0030.00617.09
8.0.100.0070.00016.97
8.0.90.0080.00017.14
8.0.80.0100.01017.06
8.0.70.0070.00017.17
8.0.60.0000.00717.09
8.0.50.0000.00816.98
8.0.30.0100.00817.25
8.0.20.0090.00917.40
8.0.10.0080.00017.27
8.0.00.0080.01216.80
7.4.330.0020.00215.55
7.4.320.0000.00616.80
7.4.300.0030.00316.82
7.4.290.0000.00716.72
7.4.280.0030.00616.61
7.4.270.0030.00316.86
7.4.260.0000.00716.67
7.4.250.0080.00016.76
7.4.240.0000.00716.59
7.4.230.0000.00716.57
7.4.220.0040.00416.70
7.4.210.0110.00716.86
7.4.200.0070.00016.47
7.4.160.0090.00716.69
7.4.140.0120.00617.86
7.4.130.0110.00616.72
7.4.120.0110.00816.75
7.4.110.0030.01516.86
7.4.100.0090.00616.81
7.4.90.0100.00716.58
7.4.80.0100.01419.39
7.4.70.0160.00416.76
7.4.60.0100.00716.62
7.4.50.0120.00216.64
7.4.40.0090.00916.75
7.4.00.0030.01415.19
7.3.330.0000.00613.36
7.3.320.0000.00513.49
7.3.310.0050.00516.59
7.3.300.0000.00716.56
7.3.290.0000.00716.38
7.3.280.0050.01416.49
7.3.260.0110.00816.70
7.3.240.0090.01016.64
7.3.230.0120.00616.57
7.3.210.0030.01316.82
7.3.200.0030.01316.58
7.3.190.0090.00616.63
7.3.180.0090.00916.59
7.3.170.0090.00916.74
7.3.160.0030.01316.80
7.3.120.0000.01614.86
7.3.110.0090.00614.99
7.3.100.0040.00815.09
7.3.90.0040.01414.84
7.3.80.0060.00914.95
7.3.70.0060.00915.13
7.3.60.0060.00315.08
7.3.50.0090.00614.77
7.3.40.0070.00715.11
7.3.30.0030.01014.68
7.3.20.0070.00716.80
7.3.10.0060.00916.83
7.3.00.0100.00616.96
7.2.330.0070.01016.91
7.2.320.0060.01616.96
7.2.310.0130.00316.84
7.2.300.0140.00316.91
7.2.290.0000.01716.93
7.2.250.0040.01115.33
7.2.240.0070.01515.25
7.2.230.0060.01215.21
7.2.220.0040.01115.17
7.2.210.0030.01315.24
7.2.200.0060.00915.16
7.2.190.0080.00615.41
7.2.180.0060.01215.05
7.2.170.0030.00714.98
7.2.110.0000.01516.63
7.2.100.0030.00916.92
7.2.90.0140.00016.70
7.2.80.0040.01116.63
7.2.70.0090.00616.84
7.2.60.0070.00717.04
7.2.50.0100.00316.96
7.2.40.0070.01116.98
7.2.30.0130.00317.18
7.2.20.0030.01017.15
7.2.10.0070.01016.84
7.2.00.0090.00617.05
7.1.330.0060.00616.09
7.1.320.0120.00616.24
7.1.310.0090.00616.13
7.1.300.0070.00715.94
7.1.290.0030.01315.92
7.1.280.0000.00915.79
7.1.270.0000.01515.91
7.1.260.0000.01015.91
7.1.230.0060.01015.68
7.1.220.0030.01215.77
7.1.210.0070.00415.96
7.1.200.0100.00715.88
7.1.190.0090.00615.69
7.1.180.0070.00715.65
7.1.170.0130.00015.92
7.1.160.0070.00715.82
7.1.150.0100.00315.81
7.1.140.0040.01116.02
7.1.130.0090.00615.92
7.1.120.0040.01115.93
7.1.110.0060.00915.91
7.1.100.0030.00915.96
7.1.90.0080.00415.93
7.1.80.0040.00816.05
7.1.70.0090.00315.98
7.1.60.0300.01334.12
7.1.50.0140.02133.89
7.1.40.0380.00033.97
7.1.30.0260.00734.05
7.1.20.0250.00633.94
7.1.10.0060.00915.95
7.1.00.0060.01015.73
5.6.380.0090.00614.36

preferences:
57.81 ms | 401 KiB | 5 Q