3v4l.org

run code in 300+ PHP versions simultaneously
<?php $callBack = function($matches){ str_replace('_', '', $matches[0]); return ucwords($matches[0]); }; $stupidName = 'stupid_function_name'; $newName = preg_replace_callback('(_[a-z])', $callBack, $stupidName);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XWWH4
function name:  (null)
number of ops:  10
compiled vars:  !0 = $callBack, !1 = $stupidName, !2 = $newName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXWWH4%3A3%240'
          1        ASSIGN                                                   !0, ~3
    8     2        ASSIGN                                                   !1, 'stupid_function_name'
   10     3        INIT_FCALL                                               'preg_replace_callback'
          4        SEND_VAL                                                 '%28_%5Ba-z%5D%29'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXWWH4%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XWWH4
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '_'
          3        SEND_VAL                                                 ''
          4        FETCH_DIM_R                                      ~1      !0, 0
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'ucwords'
          8        FETCH_DIM_R                                      ~3      !0, 0
          9        SEND_VAL                                                 ~3
         10        DO_ICALL                                         $4      
         11      > RETURN                                                   $4
    6    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXWWH4%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.5 ms | 1395 KiB | 19 Q