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('myparent'); echo $reflection->isFinal ? 'yes' : 'no';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EaY9R
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                                              'myparent'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $6
   26    11        FETCH_OBJ_R                                      ~9      !1, 'isFinal'
         12      > JMPZ                                                     ~9, ->15
         13    >   QM_ASSIGN                                        ~10     'yes'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~10     'no'
         16    >   ECHO                                                     ~10
         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/EaY9R
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/EaY9R
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/EaY9R
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/EaY9R
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:
145.29 ms | 1390 KiB | 13 Q