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\'] Hello, view this pdf <object data="https://myurl.com/media/hello.pdf" class="pdf-shortcode- iframe" type="application/pdf"> <iframe class="pdf-shortcode-iframe" src="https://docs.google.com/viewer? url=https://myurl.com/media/hello.pdf&embedded=true"></iframe> </object> and then view this PDF <object data="https://myurl.com/media/goodmorning.pdf" class="pdf- shortcode-iframe" type="application/pdf"> <iframe class="pdf-shortcode-iframe" src="https://docs.google.com/viewer? url=https://myurl.com/media/hello.pdf&embedded=true"></iframe> </object>'; $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.0140.00716.63
8.3.50.0070.00716.36
8.3.40.0110.01118.96
8.3.30.0110.00318.84
8.3.20.0080.00020.16
8.3.10.0080.00023.48
8.3.00.0040.00421.96
8.2.180.0120.00916.63
8.2.170.0070.00722.96
8.2.160.0110.00419.13
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00021.27
8.2.120.0040.00426.35
8.2.110.0080.00322.30
8.2.100.0030.00917.97
8.2.90.0050.00318.02
8.2.80.0040.00418.04
8.2.70.0040.00417.78
8.2.60.0040.00418.22
8.2.50.0030.00518.10
8.2.40.0000.00720.59
8.2.30.0030.00621.13
8.2.20.0040.00418.01
8.2.10.0030.00617.90
8.2.00.0080.00018.17
8.1.280.0090.00625.92
8.1.270.0040.00422.14
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00020.42
8.1.230.0110.00320.87
8.1.220.0060.00320.84
8.1.210.0030.00718.77
8.1.200.0100.00017.48
8.1.190.0030.00617.38
8.1.180.0040.00418.10
8.1.170.0060.00318.75
8.1.160.0070.00019.06
8.1.150.0040.00418.79
8.1.140.0000.00719.55
8.1.130.0030.00318.79
8.1.120.0030.00317.57
8.1.110.0000.00717.43
8.1.100.0050.00317.48
8.1.90.0040.00417.58
8.1.80.0040.00417.46
8.1.70.0000.00717.57
8.1.60.0000.00817.65
8.1.50.0030.00517.63
8.1.40.0040.00417.48
8.1.30.0070.00017.68
8.1.20.0000.00817.80
8.1.10.0090.00017.57
8.1.00.0040.00417.63
8.0.300.0040.00421.91
8.0.290.0040.00417.00
8.0.280.0040.00418.39
8.0.270.0070.00017.30
8.0.260.0030.00316.99
8.0.250.0000.00717.09
8.0.240.0000.00817.02
8.0.230.0000.00817.02
8.0.220.0000.00717.09
8.0.210.0050.00316.97
8.0.200.0060.00017.11
8.0.190.0070.00016.97
8.0.180.0050.00517.09
8.0.170.0040.00317.11
8.0.160.0070.00017.18
8.0.150.0040.00417.11
8.0.140.0040.00317.04
8.0.130.0030.00313.45
8.0.120.0040.00417.01
8.0.110.0030.00616.98
8.0.100.0000.00816.91
8.0.90.0040.00416.86
8.0.80.0150.00716.95
8.0.70.0000.00717.06
8.0.60.0030.00516.96
8.0.50.0040.00417.04
8.0.30.0130.00317.13
8.0.20.0140.00517.45
8.0.10.0060.00317.19
8.0.00.0090.01316.73
7.4.330.0030.00315.55
7.4.320.0060.00016.78
7.4.300.0000.00616.78
7.4.290.0040.00416.67
7.4.280.0000.00716.76
7.4.270.0070.00016.63
7.4.260.0030.00516.56
7.4.250.0070.00016.73
7.4.240.0030.00316.78
7.4.230.0030.00316.84
7.4.220.0190.01016.73
7.4.210.0090.00716.77
7.4.200.0070.00016.65
7.4.160.0110.00616.64
7.4.150.0070.01117.40
7.4.140.0130.00817.86
7.4.130.0040.01616.67
7.4.120.0070.01216.68
7.4.110.0130.00316.73
7.4.100.0160.00416.85
7.4.90.0100.01316.78
7.4.80.0140.00319.39
7.4.70.0160.00016.70
7.4.60.0110.00716.94
7.4.50.0030.01516.68
7.4.40.0160.00016.56
7.4.30.0140.01116.68
7.4.00.0110.00715.05
7.3.330.0050.00013.19
7.3.320.0030.00313.19
7.3.310.0030.00316.24
7.3.300.0000.00716.26
7.3.290.0040.00416.39
7.3.280.0100.00616.37
7.3.270.0120.00617.40
7.3.260.0080.01316.66
7.3.250.0110.00816.53
7.3.240.0100.00916.49
7.3.230.0140.01016.37
7.3.210.0070.01016.75
7.3.200.0060.01016.39
7.3.190.0120.00916.69
7.3.180.0060.01116.46
7.3.170.0030.01316.31
7.3.160.0090.00916.42
7.2.330.0070.01016.86
7.2.320.0130.00316.66
7.2.310.0100.00716.75
7.2.300.0120.00416.86
7.2.290.0130.00316.59
7.2.60.0040.01117.08
7.2.00.0000.01419.75
7.1.200.0030.00915.77
7.1.100.0070.00718.17
7.1.70.0040.01117.33
7.1.60.0190.00935.30
7.1.50.0220.00734.79
7.1.40.0200.01034.70
7.1.30.0180.01134.93
7.1.20.0160.01634.68
7.1.10.0090.00916.71
7.1.00.0040.01116.92
7.0.200.0060.00617.03
7.0.190.0070.00717.10
7.0.180.0030.01216.51
7.0.170.0110.00816.36
7.0.160.0050.01016.48
7.0.150.0060.00816.38
7.0.140.0000.01416.47
7.0.130.0030.01416.63
7.0.120.0030.01016.71
7.0.110.0040.01416.60
7.0.100.0040.01116.52
7.0.90.0000.01816.57
7.0.80.0070.00716.45
7.0.70.0030.01216.43
7.0.60.0100.00616.24
7.0.50.0130.00416.41
7.0.40.0070.00716.82
7.0.30.0030.01216.58
7.0.20.0070.00716.78
7.0.10.0040.01016.54
7.0.00.0030.01016.70

preferences:
37.32 ms | 400 KiB | 5 Q