3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class CLS { public function &__get($key) { echo "__get " . $key . PHP_EOL; return $this->$key; } } $magicTest = new CLS(); $test = "test"; $magicTest->v = & $test; echo ($magicTest->v ?? "null") . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rMHdN
function name:  (null)
number of ops:  12
compiled vars:  !0 = $magicTest, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'CLS'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        ASSIGN                                                   !1, 'test'
   14     4        ASSIGN_OBJ_REF                                           !0, 'v'
          5        OP_DATA                                                  !1
   15     6        FETCH_OBJ_IS                                     ~7      !0, 'v'
          7        COALESCE                                         ~8      ~7
          8        QM_ASSIGN                                        ~8      'null'
          9        CONCAT                                           ~9      ~8, '%0A'
         10        ECHO                                                     ~9
   16    11      > RETURN                                                   1

Class CLS:
Function __get:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/rMHdN
function name:  __get
number of ops:  7
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        CONCAT                                           ~1      '__get+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    7     4        FETCH_OBJ_W                                      $3      !0
          5      > RETURN_BY_REF                                            $3
    8     6*     > RETURN_BY_REF                                            null

End of function __get

End of class CLS.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.49 ms | 1393 KiB | 13 Q