3v4l.org

run code in 500+ PHP versions simultaneously
<?php class P { /** * @param static[] $a */ public static function f( array $a ):void { } } class C extends P { public function __construct( private int $v ) {} #[Override] public static function f( array $a ):void { foreach ($a as $me) { echo ((string) $me->v) . PHP_EOL; } } } $list = [ new C(1), new C(2), ]; C::f($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ussLP
function name:  (null)
number of ops:  13
compiled vars:  !0 = $list
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   NEW                                                  $1      'C'
          1        SEND_VAL_EX                                                  1
          2        DO_FCALL                                          0          
          3        INIT_ARRAY                                           ~3      $1
   31     4        NEW                                                  $4      'C'
          5        SEND_VAL_EX                                                  2
          6        DO_FCALL                                          0          
          7        ADD_ARRAY_ELEMENT                                    ~3      $4
   29     8        ASSIGN                                                       !0, ~3
   34     9        INIT_STATIC_METHOD_CALL                                      'C', 'f'
         10        SEND_VAR                                                     !0
         11        DO_FCALL                                          0          
         12      > RETURN                                                       1

Class P:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ussLP
function name:  f
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
   11     1      > RETURN                                                       null

End of function f

End of class P.

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ussLP
function name:  __construct
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'v'
          2        OP_DATA                                                      !0
   17     3      > RETURN                                                       null

End of function __construct

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/ussLP
function name:  f
number of ops:  10
compiled vars:  !0 = $a, !1 = $me
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
   23     1      > FE_RESET_R                                           $2      !0, ->8
          2    > > FE_FETCH_R                                                   $2, !1, ->8
   24     3    >   FETCH_OBJ_R                                          ~3      !1, 'v'
          4        CAST                                              6  ~4      ~3
          5        CONCAT                                               ~5      ~4, '%0A'
          6        ECHO                                                         ~5
   23     7      > JMP                                                          ->2
          8    >   FE_FREE                                                      $2
   26     9      > RETURN                                                       null

End of function f

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.77 ms | 1312 KiB | 13 Q