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 $res;//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.0000.01818.32
8.3.50.0150.00318.10
8.3.40.0160.00018.80
8.3.30.0180.00318.76
8.3.20.0000.00719.39
8.3.10.0040.00421.80
8.3.00.0040.00420.56
8.2.180.0090.00618.20
8.2.170.0110.00322.96
8.2.160.0150.00021.19
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0000.00819.89
8.2.120.0080.00026.35
8.2.110.0220.00319.39
8.2.100.0040.00817.84
8.2.90.0080.00017.75
8.2.80.0000.00817.97
8.2.70.0000.00818.04
8.2.60.0040.00418.09
8.2.50.0030.00618.10
8.2.40.0000.00719.32
8.2.30.0000.00719.24
8.2.20.0050.00318.15
8.2.10.0000.00818.12
8.2.00.0080.00018.01
8.1.280.0110.00725.92
8.1.270.0000.00818.88
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0100.00022.47
8.1.230.0000.01122.17
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0070.00617.63
8.1.190.0000.00817.13
8.1.180.0030.00518.10
8.1.170.0090.00018.68
8.1.160.0000.00718.92
8.1.150.0000.00818.92
8.1.140.0040.00422.21
8.1.130.0000.00820.13
8.1.120.0030.00517.61
8.1.110.0090.00017.64
8.1.100.0040.00417.60
8.1.90.0000.00717.63
8.1.80.0040.00417.65
8.1.70.0000.00817.63
8.1.60.0040.00417.73
8.1.50.0000.00817.59
8.1.40.0080.00017.62
8.1.30.0030.00617.78
8.1.20.0040.00417.86
8.1.10.0070.00317.66
8.1.00.0000.00817.55
8.0.300.0040.00418.77
8.0.290.0080.00017.00
8.0.280.0040.00418.36
8.0.270.0030.00317.27
8.0.260.0070.00018.42
8.0.250.0000.00717.17
8.0.240.0040.00417.14
8.0.230.0030.00317.05
8.0.220.0030.00616.98
8.0.210.0050.00317.14
8.0.200.0050.00217.08
8.0.190.0000.00717.20
8.0.180.0030.00617.01
8.0.170.0080.00017.15
8.0.160.0040.00417.07
8.0.150.0000.00716.99
8.0.140.0050.00316.94
8.0.130.0030.00313.48
8.0.120.0000.00817.14
8.0.110.0070.00317.08
8.0.100.0040.00416.96
8.0.90.0070.00017.11
8.0.80.0050.01117.04
8.0.70.0000.00817.03
8.0.60.0000.00717.16
8.0.50.0000.00716.99
8.0.30.0100.00817.27
8.0.20.0160.00317.40
8.0.10.0070.00017.24
8.0.00.0100.00817.01
7.4.330.0000.00515.55
7.4.320.0030.00316.72
7.4.300.0030.00316.67
7.4.290.0000.00716.71
7.4.280.0030.00616.81
7.4.270.0000.00716.80
7.4.260.0040.00416.68
7.4.250.0030.00316.61
7.4.240.0040.00416.79
7.4.230.0040.00416.60
7.4.220.0030.00616.61
7.4.210.0060.01316.76
7.4.200.0000.00716.88
7.4.160.0080.01116.83
7.4.140.0090.01017.86
7.4.130.0120.00816.89
7.4.120.0130.00616.78
7.4.110.0150.00416.69
7.4.100.0140.00716.83
7.4.90.0060.01216.75
7.4.80.0160.00019.39
7.4.70.0080.01116.70
7.4.60.0110.00716.92
7.4.50.0060.01016.71
7.4.40.0070.01016.82
7.4.00.0030.01215.13
7.3.330.0000.00513.51
7.3.320.0030.00313.29
7.3.310.0000.00916.50
7.3.300.0030.00316.37
7.3.290.0030.00316.39
7.3.280.0090.00616.53
7.3.260.0100.00816.69
7.3.240.0080.01116.65
7.3.230.0120.00916.73
7.3.210.0070.01016.74
7.3.200.0090.01316.82
7.3.190.0060.01216.63
7.3.180.0100.00716.56
7.3.170.0180.00316.57
7.3.160.0080.01516.70
7.3.120.0030.01415.16
7.3.110.0130.00314.65
7.3.100.0030.01015.06
7.3.90.0060.00914.76
7.3.80.0000.00915.16
7.3.70.0060.00615.04
7.3.60.0090.00614.90
7.3.50.0060.00614.85
7.3.40.0100.00314.77
7.3.30.0030.01214.80
7.3.20.0040.00816.85
7.3.10.0070.00716.80
7.3.00.0030.00716.53
7.2.330.0080.01216.68
7.2.320.0030.01616.59
7.2.310.0080.00816.77
7.2.300.0140.00316.77
7.2.290.0140.00616.70
7.2.250.0080.00914.74
7.2.240.0000.01715.21
7.2.230.0060.00615.28
7.2.220.0000.01514.89
7.2.210.0030.01315.13
7.2.200.0000.01115.30
7.2.190.0090.00915.31
7.2.180.0060.01015.23
7.2.170.0000.01315.02
7.2.110.0090.00616.73
7.2.100.0840.00314.85
7.2.90.0030.01216.78
7.2.80.0080.00816.71
7.2.70.0090.00416.85
7.2.60.0600.01016.83
7.2.50.0090.00617.06
7.2.40.0090.00616.88
7.2.30.0520.00315.16
7.2.20.0100.00316.94
7.2.10.0040.01016.77
7.2.00.0450.00615.05
7.1.330.0110.00415.88
7.1.320.0030.00916.16
7.1.310.0060.00915.79
7.1.300.0090.00315.97
7.1.290.0030.00616.18
7.1.280.0070.00715.61
7.1.270.0000.00915.93
7.1.260.0070.00715.55
7.1.230.0040.01115.96
7.1.220.0080.00515.95
7.1.210.0480.00614.09
7.1.200.0110.00415.86
7.1.190.0510.00415.66
7.1.180.0090.00615.83
7.1.170.0080.00815.92
7.1.160.0040.01115.97
7.1.150.0580.00716.05
7.1.140.0060.01115.96
7.1.130.0440.00414.31
7.1.120.0410.00814.08
7.1.110.0030.01016.03
7.1.100.0640.00015.98
7.1.90.0110.00416.04
7.1.80.0520.00614.16
7.1.70.0050.00916.00
7.1.60.0260.01333.89
7.1.50.0250.01133.85
7.1.40.0770.00334.00
7.1.30.0280.00733.97
7.1.20.0220.01833.92
7.1.10.0090.00615.91
7.1.00.0120.00315.90
5.6.380.0100.00514.13

preferences:
47.71 ms | 400 KiB | 5 Q