3v4l.org

run code in 300+ PHP versions simultaneously
<?php $thisid= '{7370418c-3e5a-b044-8db3-4bba6d805f72}'; $elementId = 'a test working!'; $thisurl = 'This is {7370418c-3e5a-b044-8db3-4bba6d805f72}'; function getElementPath($elementId, $thisid, $thisurl) { return preg_replace(sprintf('/%s$/', $thisid), $elementId, $thisurl); } function getElementPathFixed($elementId, $thisid, $thisurl) { return preg_replace(sprintf('/%s$/', preg_quote($thisid)), $elementId, $thisurl); } // The problem var_dump(getElementPath($elementId, $thisid, $thisurl)); // The fix var_dump(getElementPathFixed($elementId, $thisid, $thisurl));

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.110.0030.00618.48
8.3.100.0100.00716.79
8.3.90.0120.00618.58
8.3.80.0060.00317.97
8.3.70.0090.00616.63
8.3.60.0150.00018.54
8.3.50.0120.00818.45
8.3.40.0060.00918.66
8.3.30.0040.01118.79
8.3.20.0000.00821.90
8.3.10.0030.00518.90
8.3.00.0040.00421.73
8.2.230.0030.00620.94
8.2.220.0000.00824.06
8.2.210.0040.00426.77
8.2.200.0090.00018.54
8.2.190.0100.00717.00
8.2.180.0110.00418.66
8.2.170.0030.01022.96
8.2.160.0040.01520.26
8.2.150.0000.00924.18
8.2.140.0080.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0040.00420.93
8.2.100.0080.00418.09
8.2.90.0040.00418.03
8.2.80.0000.00818.04
8.2.70.0030.00717.91
8.2.60.0030.00618.08
8.2.50.0050.00319.41
8.2.40.0030.00521.14
8.2.30.0000.00720.35
8.2.20.0070.00017.91
8.2.10.0040.00419.00
8.2.00.0040.00419.67
8.1.290.0000.00918.88
8.1.280.0090.00625.92
8.1.270.0090.00020.58
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00320.93
8.1.230.0080.00422.80
8.1.220.0060.00317.74
8.1.210.0080.00018.77
8.1.200.0000.00817.35
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0040.00418.65
8.1.160.0030.00618.87
8.1.150.0070.00018.87
8.1.140.0000.00720.33
8.1.130.0000.00722.06
8.1.120.0080.00017.52
8.1.110.0030.00617.43
8.1.100.0000.00817.43
8.1.90.0030.00617.50
8.1.80.0070.00017.48
8.1.70.0040.00417.50
8.1.60.0000.00817.75
8.1.50.0000.00817.56
8.1.40.0030.00517.64
8.1.30.0030.00617.74
8.1.20.0000.00817.71
8.1.10.0040.00417.52
8.1.00.0040.00417.50
8.0.300.0070.00019.85
8.0.290.0070.00316.75
8.0.280.0070.00018.36
8.0.270.0050.00217.22
8.0.260.0030.00318.32
8.0.250.0080.00017.14
8.0.240.0040.00417.02
8.0.230.0000.00717.12
8.0.220.0000.00816.93
8.0.210.0000.00717.08
8.0.200.0070.00017.13
8.0.190.0000.00817.10
8.0.180.0040.00417.04
8.0.170.0040.00417.10
8.0.160.0030.00617.11
8.0.150.0000.00717.06
8.0.140.0000.00717.04
8.0.130.0030.00313.40
8.0.120.0040.00416.96
8.0.110.0050.00316.91
8.0.100.0000.00716.94
8.0.90.0000.00717.11
8.0.80.0070.00717.04
8.0.70.0040.00416.90
8.0.60.0040.00416.85
8.0.50.0050.00216.96
8.0.30.0070.01117.19
8.0.20.0150.01117.12
8.0.10.0050.00217.15
8.0.00.0100.00916.79
7.4.330.0030.00315.55
7.4.320.0000.00616.65
7.4.300.0050.00216.70
7.4.290.0040.00416.86
7.4.280.0000.00816.65
7.4.270.0070.00016.81
7.4.260.0000.00816.66
7.4.250.0070.00016.59
7.4.240.0040.00416.82
7.4.230.0000.00816.91
7.4.220.0040.00416.48
7.4.210.0080.00716.81
7.4.200.0030.00516.82
7.4.160.0120.00616.66
7.4.140.0130.00717.86
7.4.130.0110.00716.62
7.4.120.0120.01216.88
7.4.110.0090.00916.79
7.4.100.0060.01016.74
7.4.90.0080.00816.93
7.4.80.0180.00619.39
7.4.70.0070.01016.82
7.4.60.0070.01016.54
7.4.50.0030.01216.59
7.4.40.0140.00316.88
7.4.00.0050.01114.97
7.3.330.0060.00013.41
7.3.320.0000.00613.43
7.3.310.0050.00216.33
7.3.300.0070.00016.42
7.3.290.0030.00316.32
7.3.280.0100.00716.46
7.3.260.0110.00716.72
7.3.230.0070.01316.46
7.3.210.0070.01016.52
7.3.200.0070.01116.67
7.3.190.0140.00416.64
7.3.180.0130.00316.39
7.3.170.0040.01316.60
7.3.160.0120.00416.65
7.3.120.0060.01314.79
7.3.110.0060.01314.80
7.3.100.0070.00715.04
7.3.90.0000.00914.96
7.3.80.0090.00615.10
7.3.70.0030.00815.02
7.3.60.0090.00914.88
7.3.50.0130.00714.81
7.3.40.0060.00914.93
7.3.30.0110.01014.78
7.3.20.0120.01015.49
7.3.10.0130.00815.42
7.3.00.0100.01015.60
7.2.330.0030.02116.46
7.2.320.0100.00716.49
7.2.310.0030.01316.47
7.2.300.0070.01116.46
7.2.290.0140.00316.60
7.2.250.0000.01614.88
7.2.240.0130.00714.91
7.2.230.0070.00715.05
7.2.220.0090.00614.96
7.2.210.0080.00314.70
7.2.200.0150.00015.27
7.2.190.0060.01314.79
7.2.180.0040.01314.88
7.2.170.0020.01215.02
7.2.160.0080.01114.95
7.2.150.0460.01114.93
7.2.140.0170.00714.94
7.2.130.0170.00314.99
7.2.120.0080.00714.77
7.2.110.0170.00715.00
7.2.100.0200.00814.99
7.2.90.0120.00314.89
7.2.80.0100.00414.99
7.2.70.0250.00615.66
7.2.60.0090.00515.90
7.2.50.0050.00915.94
7.2.40.0150.00316.01
7.2.30.0100.00815.82
7.2.20.0080.00515.67
7.2.10.0080.00515.98
7.2.00.0060.00615.92
7.1.330.0060.01015.72
7.1.320.0090.00615.94
7.1.310.0060.00915.93
7.1.300.0180.00814.89
7.1.290.0100.00814.78
7.1.280.0130.00614.56
7.1.270.0080.01014.45
7.1.260.0110.01014.54
7.1.250.0160.00514.06

preferences:
28.75 ms | 403 KiB | 5 Q