3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = "Hello foo"; echo preg_replace_callback( '/\bfoo\b/i', function ($match) { return 'bar'; }, $subject );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gcNKH
function name:  (null)
number of ops:  9
compiled vars:  !0 = $subject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Hello+foo'
    4     1        INIT_FCALL                                               'preg_replace_callback'
    5     2        SEND_VAL                                                 '%2F%5Cbfoo%5Cb%2Fi'
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgcNKH%3A7%240'
   10     4        SEND_VAL                                                 ~2
   12     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
   13     8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FgcNKH%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gcNKH
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1      > RETURN                                                   'bar'
   10     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FgcNKH%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.06 ms | 1394 KiB | 15 Q