3v4l.org

run code in 500+ PHP versions simultaneously
<?php $urls = [ 'www.example.com/anything.jpg', //Skip - Do Nothing because its a file from root 'www.example.com/anything', //anything == ?data=$1 'www.example.com/something/b', //something == ?data=$1 b == &query=$2 'www.example.com/certainly/b/c', //certainly == ?data=$1 b/c == &query=$2 'www.example.com/anything/b/c.jpg', //anything == ?data=$1 b/c.jpg == &query=$2 'www.example.com/but/b/c/d', //but == ?data=$1 b/c/d == &query=$2 ]; var_export( preg_replace('~www\.example\.com/(?![^/]+\.jpg)([^/]+)(?:/(.+))?~', 'www.example.com?data=$1&query=$2', $urls) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pNs6O
function name:  (null)
number of ops:  7
compiled vars:  !0 = $urls
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        INIT_FCALL                                                   'var_export'
   13     2        FRAMELESS_ICALL_3                preg_replace        ~2      '%7Ewww%5C.example%5C.com%2F%28%3F%21%5B%5E%2F%5D%2B%5C.jpg%29%28%5B%5E%2F%5D%2B%29%28%3F%3A%2F%28.%2B%29%29%3F%7E', 'www.example.com%3Fdata%3D%241%26query%3D%242'
          3        OP_DATA                                                      !0
          4        SEND_VAL                                                     ~2
   12     5        DO_ICALL                                                     
   14     6      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.3 ms | 1607 KiB | 9 Q