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'); echo $reflection->isInstance($child) ? 'yes' : 'no';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iFtvk
function name:  (null)
number of ops:  20
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_METHOD_CALL                                         !1, 'isInstance'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $9      
         14      > JMPZ                                                     $9, ->17
         15    >   QM_ASSIGN                                        ~10     'yes'
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~10     'no'
         18    >   ECHO                                                     ~10
         19      > RETURN                                                   1

Class myparent:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iFtvk
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/iFtvk
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/iFtvk
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/iFtvk
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:
159.21 ms | 1399 KiB | 13 Q