3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert_case($name) { return implode( '_', array_map( 'strtolower', preg_split('/(([A-Z]+)[^A-Z]*)/', $name, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) ) ); } $samples = array( 'FooBar', 'FooBAR', 'FOObar', ); echo json_encode(array_map("convert_case", $samples), JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p6A2T
function name:  (null)
number of ops:  11
compiled vars:  !0 = $samples
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'json_encode'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'convert_case'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        SEND_VAL                                                 128
          8        DO_ICALL                                         $3      
          9        ECHO                                                     $3
         10      > RETURN                                                   1

Function convert_case:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p6A2T
function name:  convert_case
number of ops:  17
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'implode'
    6     2        SEND_VAL                                                 '_'
    7     3        INIT_FCALL                                               'array_map'
    8     4        SEND_VAL                                                 'strtolower'
    9     5        INIT_FCALL                                               'preg_split'
          6        SEND_VAL                                                 '%2F%28%28%5BA-Z%5D%2B%29%5B%5EA-Z%5D%2A%29%2F'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 null
          9        SEND_VAL                                                 3
         10        DO_ICALL                                         $1      
         11        SEND_VAR                                                 $1
         12        DO_ICALL                                         $2      
         13        SEND_VAR                                                 $2
         14        DO_ICALL                                         $3      
         15      > RETURN                                                   $3
   12    16*     > RETURN                                                   null

End of function convert_case

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.86 ms | 1396 KiB | 21 Q