3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myparent { public function foo($bar) { // do stuff } } class mychild extends myparent { public $val; private function bar(myparent &$baz) { // do stuff } public function __construct($val) { $this->val = $val; } } $child = new mychild('hello world'); $child->foo('test'); $reflection = new reflectionClass('mychild'); print_r( $reflection->getMethod('foo'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nppbK
function name:  (null)
number of ops:  18
compiled vars:  !0 = $child, !1 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'mychild'
          1        SEND_VAL_EX                                              'hello+world'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   21     4        INIT_METHOD_CALL                                         !0, 'foo'
          5        SEND_VAL_EX                                              'test'
          6        DO_FCALL                                      0          
   25     7        NEW                                              $6      'reflectionClass'
          8        SEND_VAL_EX                                              'mychild'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $6
   26    11        INIT_FCALL                                               'print_r'
         12        INIT_METHOD_CALL                                         !1, 'getMethod'
         13        SEND_VAL_EX                                              'foo'
         14        DO_FCALL                                      0  $9      
         15        SEND_VAR                                                 $9
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function foo

End of class myparent.

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

End of function bar

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

End of function __construct

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

End of function foo

End of class mychild.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.17 ms | 1400 KiB | 15 Q