3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["prefix" => "a", "children" => ["prefix" => "b", "children" => ["prefix" => "c", "children" => []]]]; function getPrefix($v, $k) { global $ps; if ($k == "prefix") $ps[] = $v; } array_walk_recursive($arr, 'getPrefix'); print_r($ps); echo implode("/", $ps);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kv2bN
function name:  (null)
number of ops:  14
compiled vars:  !0 = $arr, !1 = $ps
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'array_walk_recursive'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'getPrefix'
          4        DO_ICALL                                                 
    7     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    8     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%2F'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        ECHO                                                     $5
         13      > RETURN                                                   1

Function getprefix:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Kv2bN
function name:  getPrefix
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $ps
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_GLOBAL                                              !2, 'ps'
          3        IS_EQUAL                                                 !1, 'prefix'
          4      > JMPZ                                                     ~3, ->7
          5    >   ASSIGN_DIM                                               !2
          6        OP_DATA                                                  !0
          7    > > RETURN                                                   null

End of function getprefix

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.08 ms | 1002 KiB | 16 Q