3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { private $var = 'test'; public function test() { echo $this->var . "\n"; } public function __get($name) { trigger_error('In __get()', E_USER_NOTICE); return $this->$name ?? NULL; } } class B { } $a = new A(); $b = new B(); $a->test(); echo($a->var); var_dump($b->blag);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9uHdt
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   NEW                                                  $2      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   22     3        NEW                                                  $5      'B'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $5
   23     6        INIT_METHOD_CALL                                             !0, 'test'
          7        DO_FCALL                                          0          
   24     8        FETCH_OBJ_R                                          ~9      !0, 'var'
          9        ECHO                                                         ~9
   25    10        INIT_FCALL                                                   'var_dump'
         11        FETCH_OBJ_R                                          ~10     !1, 'blag'
         12        SEND_VAL                                                     ~10
         13        DO_ICALL                                                     
         14      > RETURN                                                       1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9uHdt
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                          ~0      'var'
          1        CONCAT                                               ~1      ~0, '%0A'
          2        ECHO                                                         ~1
    8     3      > RETURN                                                       null

End of function test

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9uHdt
function name:  __get
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        INIT_FCALL                                                   'trigger_error'
          2        SEND_VAL                                                     'In+__get%28%29'
          3        SEND_VAL                                                     1024
          4        DO_ICALL                                                     
   12     5        FETCH_OBJ_IS                                         ~2      !0
          6        COALESCE                                             ~3      ~2
          7        QM_ASSIGN                                            ~3      null
          8      > RETURN                                                       ~3
   13     9*     > RETURN                                                       null

End of function __get

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.36 ms | 1517 KiB | 15 Q