3v4l.org

run code in 300+ PHP versions simultaneously
<?php class storage { private $entityClass = 'test'; protected function getEntityClass() { return $this->entityClass; } public function __get($name) { if ($name === 'entityClass') { trigger_error('Use ::getEntityClass instead', E_USER_DEPRECATED); return $this->getEntityClass(); } } } class altStorage extends storage { public function __construct() { var_dump($this->entityClass); } } $s = new altStorage();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UdVmG
function name:  (null)
number of ops:  4
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'altStorage'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class storage:
Function getentityclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UdVmG
function name:  getEntityClass
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'entityClass'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getentityclass

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UdVmG
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        IS_IDENTICAL                                             !0, 'entityClass'
          2      > JMPZ                                                     ~1, ->10
   13     3    >   INIT_FCALL                                               'trigger_error'
          4        SEND_VAL                                                 'Use+%3A%3AgetEntityClass+instead'
          5        SEND_VAL                                                 16384
          6        DO_ICALL                                                 
   14     7        INIT_METHOD_CALL                                         'getEntityClass'
          8        DO_FCALL                                      0  $3      
          9      > RETURN                                                   $3
   16    10    > > RETURN                                                   null

End of function __get

End of class storage.

Class altStorage:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UdVmG
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'entityClass'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   22     4      > RETURN                                                   null

End of function __construct

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

End of function getentityclass

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UdVmG
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        IS_IDENTICAL                                             !0, 'entityClass'
          2      > JMPZ                                                     ~1, ->10
   13     3    >   INIT_FCALL                                               'trigger_error'
          4        SEND_VAL                                                 'Use+%3A%3AgetEntityClass+instead'
          5        SEND_VAL                                                 16384
          6        DO_ICALL                                                 
   14     7        INIT_METHOD_CALL                                         'getEntityClass'
          8        DO_FCALL                                      0  $3      
          9      > RETURN                                                   $3
   16    10    > > RETURN                                                   null

End of function __get

End of class altStorage.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.4 ms | 1006 KiB | 15 Q