3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doSomething($string) { $string[0] = strtolower($string[0]); $func = create_function('$c', 'return "_" . strtolower($c[1]);'); return preg_replace_callback('/([A-Z])/', $func, $string); } doSomething('davoid');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WBCZt
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'dosomething'
          1        SEND_VAL                                                 'davoid'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WBCZt
function name:  doSomething
number of ops:  19
compiled vars:  !0 = $string, !1 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'strtolower'
          2        FETCH_DIM_R                                      ~3      !0, 0
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                         $4      
          5        ASSIGN_DIM                                               !0, 0
          6        OP_DATA                                                  $4
    4     7        INIT_FCALL_BY_NAME                                       'create_function'
          8        SEND_VAL_EX                                              '%24c'
          9        SEND_VAL_EX                                              'return+%22_%22+.+strtolower%28%24c%5B1%5D%29%3B'
         10        DO_FCALL                                      0  $5      
         11        ASSIGN                                                   !1, $5
    5    12        INIT_FCALL                                               'preg_replace_callback'
         13        SEND_VAL                                                 '%2F%28%5BA-Z%5D%29%2F'
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $7      
         17      > RETURN                                                   $7
    6    18*     > RETURN                                                   null

End of function dosomething

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.17 ms | 1389 KiB | 21 Q