3v4l.org

run code in 500+ PHP versions simultaneously
<?php class C { public function __construct(private int $y) {} public function do(int $x) { return $this->y + $x; } } $c = new C(2); $fn = $c->do(...); print $fn(3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GTAGR
function name:  (null)
number of ops:  12
compiled vars:  !0 = $c, !1 = $fn
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $2      'C'
          1        SEND_VAL_EX                                                  2
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   10     4        INIT_METHOD_CALL                                             !0, 'do'
          5        CALLABLE_CONVERT                                     ~5      
          6        ASSIGN                                                       !1, ~5
   12     7        INIT_DYNAMIC_CALL                                            !1
          8        SEND_VAL_EX                                                  3
          9        DO_FCALL                                          0  $7      
         10        ECHO                                                         $7
         11      > RETURN                                                       1

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

End of function __construct

Function do:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GTAGR
function name:  do
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        FETCH_OBJ_R                                          ~1      'y'
          2        ADD                                                  ~2      ~1, !0
          3      > RETURN                                                       ~2
          4*     > RETURN                                                       null

End of function do

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.68 ms | 1510 KiB | 13 Q