3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Example { public $untyped = null; public mixed $typed = null; public function __get(string $prop): mixed { echo "Magic access to $prop\n"; return null; } } $example = new Example; var_dump($example->untyped, $example->typed); unset($example->untyped); unset($example->typed); var_dump($example->untyped, $example->typed);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D16Tv
function name:  (null)
number of ops:  18
compiled vars:  !0 = $example
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $1      'Example'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   14     3        INIT_FCALL                                                   'var_dump'
          4        FETCH_OBJ_R                                          ~4      !0, 'untyped'
          5        SEND_VAL                                                     ~4
          6        FETCH_OBJ_R                                          ~5      !0, 'typed'
          7        SEND_VAL                                                     ~5
          8        DO_ICALL                                                     
   16     9        UNSET_OBJ                                                    !0, 'untyped'
   17    10        UNSET_OBJ                                                    !0, 'typed'
   18    11        INIT_FCALL                                                   'var_dump'
         12        FETCH_OBJ_R                                          ~7      !0, 'untyped'
         13        SEND_VAL                                                     ~7
         14        FETCH_OBJ_R                                          ~8      !0, 'typed'
         15        SEND_VAL                                                     ~8
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Class Example:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D16Tv
function name:  __get
number of ops:  8
compiled vars:  !0 = $prop
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    8     1        ROPE_INIT                                         3  ~2      'Magic+access+to+'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%0A'
          4        ECHO                                                         ~1
    9     5      > RETURN                                                       null
   10     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function __get

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.78 ms | 1719 KiB | 14 Q