3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function b($x = [1,2,3,4]) { echo __METHOD__, PHP_EOL; echo __FUNCTION__, PHP_EOL; if (is_array($x)) { array_walk($x, __METHOD__); } 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/UU4I0
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     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 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UU4I0
function name:  b
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <array>
    6     1        ECHO                                                     'a%3A%3Ab'
          2        ECHO                                                     '%0A'
    7     3        ECHO                                                     'b'
          4        ECHO                                                     '%0A'
    9     5        TYPE_CHECK                                  128          !0
          6      > JMPZ                                                     ~1, ->12
   10     7    >   INIT_FCALL                                               'array_walk'
          8        SEND_REF                                                 !0
          9        SEND_VAL                                                 'a%3A%3Ab'
         10        DO_ICALL                                                 
         11      > JMP                                                      ->13
   12    12    >   ECHO                                                     !0
   14    13    > > RETURN                                                   null

End of function b

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.47 ms | 1395 KiB | 15 Q