3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(.*?)(\[\w{3}=\')(\w+\.\w+)(\'\])(.*?)(\[\w{3}=\')(\w+\.\w+).*/s'; $str = 'Hello, view this pdf [PDF=\'hello.pdf\'] and then view this PDF [PDF=\'goodmorning.pdf\']'; $subst = '$1 <object data=\\"https://myurl.com/media/$3\\" class=\\"pdf-shortcode-iframe" type=\\"application/pdf\\"> <iframe class=\\"pdf-shortcode-iframe\\" src=\\"https://docs.google.com/viewer?url=https://myurl.com/media/$3&embedded=true\\"></iframe> </object>$5 <object data=\\"https://myurl.com/media/$7\\" class=\\"pdf-shortcode-iframe\\" type=\\"application/pdf\\"> <iframe class=\\"pdf-shortcode-iframe\\" src=\\"https://docs.google.com/viewer? url=https://myurl.com/media/$3&embedded=true"></iframe> </object>'; $result = preg_replace($re, $subst, $str); echo "The result of the substitution is ".$result;

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.0110.00716.75
8.3.50.0040.01116.37
8.3.40.0070.01118.91
8.3.30.0120.00318.73
8.3.20.0000.00820.29
8.3.10.0050.00323.52
8.3.00.0040.00422.06
8.2.180.0100.01016.63
8.2.170.0070.00722.96
8.2.160.0070.00718.99
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00421.17
8.2.120.0040.00426.35
8.2.110.0090.01222.38
8.2.100.0120.00017.61
8.2.90.0000.00822.36
8.2.80.0040.00417.97
8.2.70.0030.00517.93
8.2.60.0040.00418.04
8.2.50.0000.00818.10
8.2.40.0000.00720.57
8.2.30.0000.00821.06
8.2.20.0000.00818.17
8.2.10.0000.00918.11
8.2.00.0040.00418.21
8.1.280.0040.01125.92
8.1.270.0000.00722.13
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.47
8.1.230.0110.00020.90
8.1.220.0030.00517.78
8.1.210.0000.00819.04
8.1.200.0030.00617.36
8.1.190.0000.00817.35
8.1.180.0080.00318.10
8.1.170.0080.00020.68
8.1.160.0040.00419.03
8.1.150.0040.00418.91
8.1.140.0040.00419.55
8.1.130.0050.00318.85
8.1.120.0050.00317.64
8.1.110.0000.00817.43
8.1.100.0020.00517.59
8.1.90.0030.00517.46
8.1.80.0070.00017.51
8.1.70.0030.00317.46
8.1.60.0000.00817.63
8.1.50.0050.00317.49
8.1.40.0040.00417.56
8.1.30.0040.00417.73
8.1.20.0030.00617.68
8.1.10.0030.00617.71
8.1.00.0040.00417.62
8.0.300.0040.00419.91
8.0.290.0080.00016.88
8.0.280.0070.00018.46
8.0.270.0040.00417.29
8.0.260.0030.00316.86
8.0.250.0070.00017.07
8.0.240.0050.00216.99
8.0.230.0040.00417.01
8.0.220.0070.00017.07
8.0.210.0040.00416.92
8.0.200.0030.00317.00
8.0.190.0040.00417.09
8.0.180.0060.00617.09
8.0.170.0000.00717.05
8.0.160.0000.00717.13
8.0.150.0000.00716.89
8.0.140.0030.00316.89
8.0.130.0060.00013.57
8.0.120.0000.00716.94
8.0.110.0000.00716.92
8.0.100.0040.00416.90
8.0.90.0000.00716.94
8.0.80.0060.01316.96
8.0.70.0000.00716.96
8.0.60.0040.00416.96
8.0.50.0000.00717.04
8.0.30.0160.00417.17
8.0.20.0120.00717.41
8.0.10.0000.00916.98
8.0.00.0080.02016.82
7.4.330.0060.00015.55
7.4.320.0040.00416.66
7.4.300.0030.00316.62
7.4.290.0040.00416.73
7.4.280.0030.00616.54
7.4.270.0030.00316.70
7.4.260.0000.00816.65
7.4.250.0000.00716.75
7.4.240.0070.00016.69
7.4.230.0000.00716.69
7.4.220.0120.00616.84
7.4.210.0130.00216.81
7.4.200.0030.00316.56
7.4.160.0080.01216.61
7.4.150.0100.00717.40
7.4.140.0070.01117.86
7.4.130.0120.01216.56
7.4.120.0120.00516.59
7.4.110.0140.00316.59
7.4.100.0040.01316.62
7.4.90.0130.00316.77
7.4.80.0100.00719.39
7.4.70.0030.01316.41
7.4.60.0110.00716.63
7.4.50.0090.00616.74
7.4.40.0070.01016.62
7.4.30.0060.01216.61
7.4.00.0080.00815.08
7.3.330.0000.00513.08
7.3.320.0030.00313.24
7.3.310.0030.00316.29
7.3.300.0030.00316.41
7.3.290.0000.00716.32
7.3.280.0070.00916.34
7.3.270.0070.01017.40
7.3.260.0120.00816.41
7.3.250.0110.01016.58
7.3.240.0120.00616.35
7.3.230.0070.01016.64
7.3.210.0070.01116.48
7.3.200.0090.00916.70
7.3.190.0100.00616.48
7.3.180.0100.00716.76
7.3.170.0080.00816.66
7.3.160.0070.01016.61
7.3.120.0090.00614.82
7.3.110.0090.00015.11
7.3.100.0030.01314.86
7.3.90.0140.00314.70
7.3.80.0000.01114.87
7.3.70.0070.00415.06
7.3.60.0070.00315.04
7.3.50.0070.00315.06
7.3.40.0030.01215.02
7.3.30.0080.00814.95
7.3.20.0030.01216.71
7.3.10.0060.00816.66
7.3.00.0060.00716.71
7.2.330.0140.00416.64
7.2.320.0040.01816.83
7.2.310.0140.00316.83
7.2.300.0060.01116.83
7.2.290.0060.00916.77
7.2.250.0040.00815.18
7.2.240.0070.01015.11
7.2.230.0070.01115.36
7.2.220.0060.00915.27
7.2.210.0100.00715.29
7.2.200.0040.00815.12
7.2.190.0000.01415.13
7.2.180.0070.00715.20
7.2.170.0070.00415.33
7.2.130.0060.00917.21
7.2.120.0030.01116.86
7.2.110.0060.00517.01
7.2.100.0070.00716.94
7.2.90.0080.00616.98
7.2.80.0040.00916.66
7.2.70.0080.00617.05
7.2.60.0140.00917.03
7.2.50.0070.00717.08
7.2.40.0000.01317.09
7.2.30.0070.00717.17
7.2.20.0050.00917.20
7.2.10.0050.00916.95
7.2.00.0080.00818.00
7.1.330.0140.00015.95
7.1.320.0030.00815.70
7.1.310.0040.01116.17
7.1.300.0040.00815.72
7.1.290.0030.01415.63
7.1.280.0030.01015.99
7.1.270.0110.00316.00
7.1.260.0060.00615.98
7.1.250.0100.00316.01
7.1.240.0030.00616.09
7.1.230.0120.00016.11
7.1.220.0000.01115.95
7.1.210.0000.01015.80
7.1.200.0040.01115.85
7.1.190.0030.00715.91
7.1.180.0100.00315.70
7.1.170.0040.00415.89
7.1.160.0030.01015.97
7.1.150.0060.00616.00
7.1.140.0030.00915.89
7.1.130.0000.00715.69
7.1.120.0050.00515.81
7.1.110.0060.00615.95
7.1.100.0030.01016.80
7.1.90.0050.00516.11
7.1.80.0060.00616.02
7.1.70.0150.00515.69
7.1.60.0250.00724.77
7.1.50.0290.00524.57
7.1.40.0110.01824.19
7.1.30.0190.00924.38
7.1.20.0220.00924.52
7.1.10.0110.00515.47
7.1.00.0100.00715.64
7.0.320.0110.00315.63
7.0.310.0030.00615.32
7.0.300.0060.00615.47
7.0.290.0000.00615.54
7.0.280.0050.00315.63
7.0.270.0030.00615.46
7.0.260.0090.00315.32
7.0.250.0030.00615.85
7.0.240.0060.00315.52
7.0.230.0080.00315.54
7.0.220.0060.00615.29
7.0.210.0000.00615.78
7.0.200.0200.00315.31
7.0.190.0130.00815.45
7.0.180.0090.01215.06
7.0.170.0110.00715.01
7.0.160.0140.00515.09
7.0.150.0100.00714.97
7.0.140.0130.00815.13
7.0.130.0130.00615.20
7.0.120.0130.00715.27
7.0.110.0120.00714.99
7.0.100.0120.00515.07
7.0.90.0110.00915.23
7.0.80.0120.01015.08
7.0.70.0160.00215.07
7.0.60.0110.00915.20
7.0.50.0160.00515.17
7.0.40.0090.00914.42
7.0.30.0130.00714.32
7.0.20.0100.00914.17
7.0.10.0110.00914.23
7.0.00.0120.00814.30
5.6.380.0040.00414.52

preferences:
47.62 ms | 400 KiB | 5 Q