3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function b($x = [1,2,3,4]) { if (is_array($x)) { array_walk($x, [$this, __FUNCTION__]); } else { echo $x; } } } $b = new a(); $b->b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBDOo
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'b'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class a:
Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBDOo
function name:  b
number of ops:  13
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <array>
    7     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->11
    8     3    >   INIT_FCALL                                               'array_walk'
          4        SEND_REF                                                 !0
          5        FETCH_THIS                                       ~2      
          6        INIT_ARRAY                                       ~3      ~2
          7        ADD_ARRAY_ELEMENT                                ~3      'b'
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                                 
         10      > JMP                                                      ->12
   10    11    >   ECHO                                                     !0
   12    12    > > RETURN                                                   null

End of function b

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.52 ms | 1395 KiB | 15 Q