3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'fdfqsdfqsdf%A%2%B%4%C%D%7sddsdfsdf'; $res = preg_replace_callback(',%.?,', function (array $matches) { if (preg_match(',%\d+,', $matches[0])) { return 'FOO'; } }, $str); echo $res; $res = preg_replace_callback(',%\d+?,', function (array $matches) { return 'FOO'; }, $str); echo $res;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpUcJ
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'fdfqsdfqsdf%25A%252%25B%254%25C%25D%257sddsdfsdf'
    4     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2C%25.%3F%2C'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZpUcJ%3A4%240'
    8     4        SEND_VAL                                                 ~3
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
    4     7        ASSIGN                                                   !1, $4
    9     8        ECHO                                                     !1
   11     9        INIT_FCALL                                               'preg_replace_callback'
         10        SEND_VAL                                                 '%2C%25%5Cd%2B%3F%2C'
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZpUcJ%3A11%241'
   13    12        SEND_VAL                                                 ~6
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
   11    15        ASSIGN                                                   !1, $7
   14    16        ECHO                                                     !1
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZpUcJ%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpUcJ
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2C%25%5Cd%2B%2C'
          3        FETCH_DIM_R                                      ~1      !0, 0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->8
    6     7    > > RETURN                                                   'FOO'
    8     8    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZpUcJ%3A4%240

Function %00%7Bclosure%7D%2Fin%2FZpUcJ%3A11%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpUcJ
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1      > RETURN                                                   'FOO'
   13     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZpUcJ%3A11%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.61 ms | 1400 KiB | 17 Q