3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { protected $_prop = 123; public function get($key) { return $this->{"_{$key}"}; } public function __get($key) { return $this->{"_{$key}"}; } } $c = new test(); echo $c->prop.PHP_EOL.$c->get('prop');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/26AF9
function name:  (null)
number of ops:  11
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        FETCH_OBJ_R                                      ~4      !0, 'prop'
          4        CONCAT                                           ~5      ~4, '%0A'
          5        INIT_METHOD_CALL                                         !0, 'get'
          6        SEND_VAL_EX                                              'prop'
          7        DO_FCALL                                      0  $6      
          8        CONCAT                                           ~7      ~5, $6
          9        ECHO                                                     ~7
         10      > RETURN                                                   1

Class test:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/26AF9
function name:  get
number of ops:  6
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      '_', !0
          3        FETCH_OBJ_R                                      ~2      ~1
          4      > RETURN                                                   ~2
   10     5*     > RETURN                                                   null

End of function get

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/26AF9
function name:  __get
number of ops:  6
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      '_', !0
          3        FETCH_OBJ_R                                      ~2      ~1
          4      > RETURN                                                   ~2
   14     5*     > RETURN                                                   null

End of function __get

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1394 KiB | 13 Q