3v4l.org

run code in 500+ PHP versions simultaneously
<?php class BaseController { public static $var_test = '#'; public function __construct() { self::$var_test = "100"; } } class AdminController extends BaseController { public function render() { echo parent::$var_test; // Prints 100 here (www.3v4l.org/mkoLL) which is correct // Prints # in CI 4 AdminController extended from BaseController which is wrong } } $adm = new AdminController; var_dump($adm->render()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9G2Ab
function name:  (null)
number of ops:  9
compiled vars:  !0 = $adm
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $1      'AdminController'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   23     3        INIT_FCALL                                                   'var_dump'
          4        INIT_METHOD_CALL                                             !0, 'render'
          5        DO_FCALL                                          0  $4      
          6        SEND_VAR                                                     $4
          7        DO_ICALL                                                     
   24     8      > RETURN                                                       1

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

End of function __construct

End of class BaseController.

Class AdminController:
Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9G2Ab
function name:  render
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   FETCH_STATIC_PROP_R              unknown             ~0      'var_test'
          1        ECHO                                                         ~0
   19     2      > RETURN                                                       null

End of function render

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9G2Ab
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_STATIC_PROP                                           'var_test'
          1        OP_DATA                                                      '100'
    9     2      > RETURN                                                       null

End of function __construct

End of class AdminController.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.55 ms | 1993 KiB | 14 Q