3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Thing{ public function doSomething() : void{} } class ParentC{ /** @var Thing|null */ protected $thing; protected function __construct(){ $this->thing = null; } } class HelloWorld extends ParentC { public function __construct(Thing $thing){ $this->thing = $thing; parent::__construct(); $this->thing->doSomething(); //bang } } new HelloWorld(new Thing);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVjQ5
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $0      'HelloWorld'
          1        NEW                                              $1      'Thing'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $1
          4        DO_FCALL                                      0          
          5        FREE                                                     $0
          6      > RETURN                                                   1

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

End of function dosomething

End of class Thing.

Class ParentC:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVjQ5
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN_OBJ                                               'thing'
          1        OP_DATA                                                  null
   13     2      > RETURN                                                   null

End of function __construct

End of class ParentC.

Class HelloWorld:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVjQ5
function name:  __construct
number of ops:  9
compiled vars:  !0 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        ASSIGN_OBJ                                               'thing'
          2        OP_DATA                                                  !0
   20     3        INIT_STATIC_METHOD_CALL                                  
          4        DO_FCALL                                      0          
   21     5        FETCH_OBJ_R                                      ~3      'thing'
          6        INIT_METHOD_CALL                                         ~3, 'doSomething'
          7        DO_FCALL                                      0          
   22     8      > RETURN                                                   null

End of function __construct

End of class HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.24 ms | 1408 KiB | 13 Q