3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { private $values; public function __construct( array $values ) { $this->values = $values; } } class ChildClass extends ParentClass { private $values; public function __construct( array $values ) { parent::__construct( $values ); $this->values = $values; } public function getTest() { if( isset( $this->values['test'] ) ) { return $this->values['test']; } } public function setTest( $value ) { return $this->values['test'] = $value; } } $object = new ChildClass( array( 'test' => 0 ) ); $object->setTest( 1 ); echo 'val: ' . $object->getTest() . PHP_EOL; print_r( $object );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7eN7
function name:  (null)
number of ops:  16
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   NEW                                              $1      'ChildClass'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   39     4        INIT_METHOD_CALL                                         !0, 'setTest'
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0          
   40     7        INIT_METHOD_CALL                                         !0, 'getTest'
          8        DO_FCALL                                      0  $5      
          9        CONCAT                                           ~6      'val%3A+', $5
         10        CONCAT                                           ~7      ~6, '%0A'
         11        ECHO                                                     ~7
   41    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class ParentClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7eN7
function name:  __construct
number of ops:  4
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'values'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

End of class ParentClass.

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

End of function __construct

Function gettest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7eN7
function name:  getTest
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_IS                                     ~0      'values'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~0, 'test'
          2      > JMPZ                                                     ~1, ->6
   27     3    >   FETCH_OBJ_R                                      ~2      'values'
          4        FETCH_DIM_R                                      ~3      ~2, 'test'
          5      > RETURN                                                   ~3
   29     6    > > RETURN                                                   null

End of function gettest

Function settest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7eN7
function name:  setTest
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   33     1        FETCH_OBJ_W                                      $1      'values'
          2        ASSIGN_DIM                                       ~2      $1, 'test'
          3        OP_DATA                                                  !0
          4      > RETURN                                                   ~2
   34     5*     > RETURN                                                   null

End of function settest

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
247.78 ms | 1400 KiB | 15 Q