3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = 'hierarchical_select'; print preg_replace('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F2ffV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'hierarchical_select'
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5E%7C_%7C%5C.%29%2B%28.%29%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FF2ffV%3A3%240'
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
          8      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.16 ms | 1395 KiB | 17 Q