3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new \StdClass; $bar = new \StdClass; $foo->bar = $bar; $bar->foo = $foo; $array = array('foo' => $foo, 'bar' => $bar); rwalk($array); function rwalk($array) { if (is_array($array)) { foreach ($array as $key => $value) { if (is_object($value)) { $value = (array) $value; } if (is_array($value)) { rwalk($value); } } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rSg42
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $bar, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        NEW                                              $6      'StdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
    4     6        ASSIGN_OBJ                                               !0, 'bar'
          7        OP_DATA                                                  !1
    5     8        ASSIGN_OBJ                                               !1, 'foo'
          9        OP_DATA                                                  !0
    6    10        INIT_ARRAY                                       ~11     !0, 'foo'
         11        ADD_ARRAY_ELEMENT                                ~11     !1, 'bar'
         12        ASSIGN                                                   !2, ~11
    8    13        INIT_FCALL_BY_NAME                                       'rwalk'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0          
   22    16      > RETURN                                                   1

Function rwalk:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 17
filename:       /in/rSg42
function name:  rwalk
number of ops:  18
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~3, ->17
   12     3    > > FE_RESET_R                                       $4      !0, ->16
          4    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          5    >   ASSIGN                                                   !2, ~5
   13     6        TYPE_CHECK                                  256          !1
          7      > JMPZ                                                     ~7, ->10
   14     8    >   CAST                                          7  ~8      !1
          9        ASSIGN                                                   !1, ~8
   17    10    >   TYPE_CHECK                                  128          !1
         11      > JMPZ                                                     ~10, ->15
   18    12    >   INIT_FCALL_BY_NAME                                       'rwalk'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
   12    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $4
   22    17    > > RETURN                                                   null

End of function rwalk

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.03 ms | 1403 KiB | 13 Q