3v4l.org

run code in 500+ PHP versions simultaneously
<?php $func = function ($property) { echo preg_replace_callback( '#(?<start>[a-z]+)(_)(?<ucfirst>[a-z]+)#msU', function ($matches) { return $matches['start'] . ucfirst($matches['ucfirst']); }, $property ); echo PHP_EOL; }; $func('$some_property'); echo PHP_EOL; $func('$this->some_property'); echo PHP_EOL; $func('$this->some_property_multiple_underscore_to_camel');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3sUK
function name:  (null)
number of ops:  14
compiled vars:  !0 = $func
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        ASSIGN                                                       !0, ~1
   15     2        INIT_DYNAMIC_CALL                                            !0
          3        SEND_VAL_EX                                                  '%24some_property'
          4        DO_FCALL                                          0          
   16     5        ECHO                                                         '%0A'
   17     6        INIT_DYNAMIC_CALL                                            !0
          7        SEND_VAL_EX                                                  '%24this-%3Esome_property'
          8        DO_FCALL                                          0          
   18     9        ECHO                                                         '%0A'
   19    10        INIT_DYNAMIC_CALL                                            !0
         11        SEND_VAL_EX                                                  '%24this-%3Esome_property_multiple_underscore_to_camel'
         12        DO_FCALL                                          0          
         13      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3sUK
function name:  {closure:/in/b3sUK:3}
number of ops:  10
compiled vars:  !0 = $property
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL                                                   'preg_replace_callback'
    5     2        SEND_VAL                                                     '%23%28%3F%3Cstart%3E%5Ba-z%5D%2B%29%28_%29%28%3F%3Cucfirst%3E%5Ba-z%5D%2B%29%23msU'
    6     3        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
    8     4        SEND_VAL                                                     ~1
    9     5        SEND_VAR                                                     !0
    4     6        DO_ICALL                                             $2      
    9     7        ECHO                                                         $2
   12     8        ECHO                                                         '%0A'
   13     9      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3sUK
function name:  {closure:{closure:/in/b3sUK:3}:6}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        FETCH_DIM_R                                          ~1      !0, 'start'
          2        INIT_FCALL                                                   'ucfirst'
          3        FETCH_DIM_R                                          ~2      !0, 'ucfirst'
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                             $3      
          6        CONCAT                                               ~4      ~1, $3
          7      > RETURN                                                       ~4
    8     8*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.61 ms | 2206 KiB | 15 Q