3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { private function foo() { return 42; } public function bar($y) { return $y->foo(); } } class Y extends X { private function foo() { explode; } } $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/k21Cj
function name:  (null)
number of ops:  11
compiled vars:  !0 = $y, !1 = $y2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     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
   10     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 foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k21Cj
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   42
          1*     > RETURN                                                   null

End of function foo

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

End of function bar

End of class X.

Class Y:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k21Cj
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CONSTANT                                   ~0      'explode'
          1        FREE                                                     ~0
          2      > RETURN                                                   null

End of function foo

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

End of function bar

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.35 ms | 1395 KiB | 13 Q