3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'some text [img:http://example.com/_data/025_img.jpg] more text'; echo preg_replace( '~\[img:\s*(https?://example\.com(?:/\w+)*\.(?:jpe?g|png|gif))]~', '<img src="$1" border="0" />', $text );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M0VbC
function name:  (null)
number of ops:  8
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'some+text+%5Bimg%3Ahttp%3A%2F%2Fexample.com%2F_data%2F025_img.jpg%5D+more+text'
    5     1        INIT_FCALL                                               'preg_replace'
    6     2        SEND_VAL                                                 '%7E%5C%5Bimg%3A%5Cs%2A%28https%3F%3A%2F%2Fexample%5C.com%28%3F%3A%2F%5Cw%2B%29%2A%5C.%28%3F%3Ajpe%3Fg%7Cpng%7Cgif%29%29%5D%7E'
    7     3        SEND_VAL                                                 '%3Cimg+src%3D%22%241%22+border%3D%220%22+%2F%3E'
    8     4        SEND_VAR                                                 !0
    5     5        DO_ICALL                                         $2      
    8     6        ECHO                                                     $2
    9     7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
214.5 ms | 1008 KiB | 14 Q