3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Lorem ipsum dolor sit amet, adipisicing <img src="http://example.com/img.jpg" />consequat.'; var_export( preg_filter('/.*?<img(?= ).*? src=([\'"])((?:(?!\1).)*)\1.*/ius', '$2', $str) ); echo "\n---\n"; $str = 'Lorem ipsum dolor sit amet, adipisicing <img src="" />consequat.'; var_export( preg_filter('/.*?<img(?= ).*? src=([\'"])((?:(?!\1).)*)\1.*/ius', '$2', $str) ); echo "\n---\n"; $str = 'omg no img tag!'; var_export( preg_filter('/.*?<img(?= ).*? src=([\'"])((?:(?!\1).)*)\1.*/ius', '$2', 'omg no img!') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H2tek
function name:  (null)
number of ops:  30
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Lorem+ipsum+dolor+sit+amet%2C+adipisicing+%3Cimg+src%3D%22http%3A%2F%2Fexample.com%2Fimg.jpg%22+%2F%3Econsequat.'
    4     1        INIT_FCALL                                               'var_export'
    5     2        INIT_FCALL                                               'preg_filter'
          3        SEND_VAL                                                 '%2F.%2A%3F%3Cimg%28%3F%3D+%29.%2A%3F+src%3D%28%5B%27%22%5D%29%28%28%3F%3A%28%3F%21%5C1%29.%29%2A%29%5C1.%2A%2Fius'
          4        SEND_VAL                                                 '%242'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
    4     8        DO_ICALL                                                 
    8     9        ECHO                                                     '%0A---%0A'
   10    10        ASSIGN                                                   !0, 'Lorem+ipsum+dolor+sit+amet%2C+adipisicing+%3Cimg+src%3D%22%22+%2F%3Econsequat.'
   11    11        INIT_FCALL                                               'var_export'
   12    12        INIT_FCALL                                               'preg_filter'
         13        SEND_VAL                                                 '%2F.%2A%3F%3Cimg%28%3F%3D+%29.%2A%3F+src%3D%28%5B%27%22%5D%29%28%28%3F%3A%28%3F%21%5C1%29.%29%2A%29%5C1.%2A%2Fius'
         14        SEND_VAL                                                 '%242'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $5      
         17        SEND_VAR                                                 $5
   11    18        DO_ICALL                                                 
   15    19        ECHO                                                     '%0A---%0A'
   16    20        ASSIGN                                                   !0, 'omg+no+img+tag%21'
   17    21        INIT_FCALL                                               'var_export'
   18    22        INIT_FCALL                                               'preg_filter'
         23        SEND_VAL                                                 '%2F.%2A%3F%3Cimg%28%3F%3D+%29.%2A%3F+src%3D%28%5B%27%22%5D%29%28%28%3F%3A%28%3F%21%5C1%29.%29%2A%29%5C1.%2A%2Fius'
         24        SEND_VAL                                                 '%242'
         25        SEND_VAL                                                 'omg+no+img%21'
         26        DO_ICALL                                         $8      
         27        SEND_VAR                                                 $8
   17    28        DO_ICALL                                                 
   19    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.75 ms | 1000 KiB | 15 Q