3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $var1 = ''; protected $var2 = ''; public function __construct(){ $this->var1 = 'Hello'; $this->var2 = 'World'; return true; } } class b extends a{ public function welcome(){ return $this->var1.$this->var2; } } $b = new b; echo $b->welcome();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/60ANp
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'welcome'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/60ANp
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                               'var1'
          1        OP_DATA                                                  'Hello'
    9     2        ASSIGN_OBJ                                               'var2'
          3        OP_DATA                                                  'World'
   10     4      > RETURN                                                   <true>
   11     5*     > RETURN                                                   null

End of function __construct

End of class a.

Class b:
Function welcome:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/60ANp
function name:  welcome
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'var1'
          1        FETCH_OBJ_R                                      ~1      'var2'
          2        CONCAT                                           ~2      ~0, ~1
          3      > RETURN                                                   ~2
   17     4*     > RETURN                                                   null

End of function welcome

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/60ANp
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                               'var1'
          1        OP_DATA                                                  'Hello'
    9     2        ASSIGN_OBJ                                               'var2'
          3        OP_DATA                                                  'World'
   10     4      > RETURN                                                   <true>
   11     5*     > RETURN                                                   null

End of function __construct

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.7 ms | 1386 KiB | 13 Q