3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public function bar($y) { return $this::foo(); } protected function foo() {return 42;} } class Y extends X { } $y = new Y; $y2 = new Y; echo $y2->bar($y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gfn5
function name:  (null)
number of ops:  11
compiled vars:  !0 = $y, !1 = $y2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'Y'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
          3        NEW                                              $5      'Y'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
    9     6        INIT_METHOD_CALL                                         !1, 'bar'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $8      
          9        ECHO                                                     $8
         10      > RETURN                                                   1

Class X:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gfn5
function name:  bar
number of ops:  7
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        FETCH_THIS                                       ~1      
          2        FETCH_CLASS                                   0  $2      ~1
          3        INIT_STATIC_METHOD_CALL                                  $2, 'foo'
          4        DO_FCALL                                      0  $3      
          5      > RETURN                                                   $3
          6*     > RETURN                                                   null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gfn5
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   42
          1*     > RETURN                                                   null

End of function foo

End of class X.

Class Y:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gfn5
function name:  bar
number of ops:  7
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        FETCH_THIS                                       ~1      
          2        FETCH_CLASS                                   0  $2      ~1
          3        INIT_STATIC_METHOD_CALL                                  $2, 'foo'
          4        DO_FCALL                                      0  $3      
          5      > RETURN                                                   $3
          6*     > RETURN                                                   null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gfn5
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   42
          1*     > RETURN                                                   null

End of function foo

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.08 ms | 1399 KiB | 13 Q