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) ) ); } echo json_encode(array_map("convert_case", array("FooBar", "FooBAR")), JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6ZQEq
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'json_encode'
          1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'convert_case'
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 128
          7        DO_ICALL                                         $1      
          8        ECHO                                                     $1
          9      > RETURN                                                   1

Function convert_case:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6ZQEq
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%5BA-Z%5D%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:
156.69 ms | 1387 KiB | 21 Q