3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string= "Hello, view this pdf [PDF='hello.pdf'] and then view this PDF [PDF='goodmorning.pdf']"; echo preg_replace("/(.*?)(\[\w{3}=\')(\w+\.\w+)(\'\](.*?)/", "$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>", $string);

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)
7.1.70.0220.00615.00
7.1.60.0230.00735.09
7.1.50.0490.01232.73
7.1.40.0200.01734.50
7.1.30.0220.00934.39
7.1.20.0220.00934.40
7.1.10.0090.00616.27
7.1.00.0090.00616.38
7.0.200.0070.01016.51
7.0.190.0240.00914.65
7.0.180.0070.00716.21
7.0.170.0060.00916.00
7.0.160.0080.00816.01
7.0.150.0060.00915.98
7.0.140.0000.01516.05
7.0.130.0050.00816.23
7.0.120.0030.01016.39
7.0.110.0070.00716.09
7.0.100.0060.00916.00
7.0.90.0040.00916.04
7.0.80.0070.00716.18
7.0.70.0000.01416.15
7.0.60.0030.01015.94
7.0.50.0000.01316.14
7.0.40.0070.00716.21
7.0.30.0090.01116.33
7.0.20.0000.01216.16
7.0.10.0060.00716.27
7.0.00.0060.00716.30

preferences:
158.57 ms | 1394 KiB | 7 Q