3v4l.org

run code in 300+ PHP versions simultaneously
<?php function short_check($a) { var_dump($a); if($a[1]==$a[2]) return ''; return $a[0]; } $_content = 'hello [shortcode some params]inner content[/shortcode] there'; $_content = preg_replace_callback('#\[(\S+)[^\]]+[^\[]+\[\/(\S+)\]#iu', 'short_check', $_content); echo $_content;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ip9FM
function name:  (null)
number of ops:  9
compiled vars:  !0 = $_content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'hello+%5Bshortcode+some+params%5Dinner+content%5B%2Fshortcode%5D+there'
    8     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%23%5C%5B%28%5CS%2B%29%5B%5E%5C%5D%5D%2B%5B%5E%5C%5B%5D%2B%5C%5B%5C%2F%28%5CS%2B%29%5C%5D%23iu'
          3        SEND_VAL                                                 'short_check'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
   10     7        ECHO                                                     !0
          8      > RETURN                                                   1

Function short_check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ip9FM
function name:  short_check
number of ops:  12
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    4     4        FETCH_DIM_R                                      ~2      !0, 1
          5        FETCH_DIM_R                                      ~3      !0, 2
          6        IS_EQUAL                                                 ~2, ~3
          7      > JMPZ                                                     ~4, ->9
          8    > > RETURN                                                   ''
    5     9    >   FETCH_DIM_R                                      ~5      !0, 0
         10      > RETURN                                                   ~5
    6    11*     > RETURN                                                   null

End of function short_check

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.34 ms | 1395 KiB | 17 Q