3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cl { public string $name; public function __get(string $n) { var_dump('__get: ' . $n); return new \stdClass(); } } $obj = new Cl(); // read on uninitialized typed property try { $obj->name; } catch (\Error $e) { echo $e->getMessage() . "\n"; } // read on unset typed property unset($obj->name); try { var_dump($obj->name); } catch (\Error $e) { echo $e->getMessage() . "\n"; } try { var_dump($obj->name); } catch (\Error $e) { echo $e->getMessage() . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Found catch point at position: 17
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Found catch point at position: 27
Branch analysis from position: 27
2 jumps found. (Code = 107) Position 1 = 28, Position 2 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6RlfS
function name:  (null)
number of ops:  33
compiled vars:  !0 = $obj, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'Cl'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        FETCH_OBJ_R                                      ~5      !0, 'name'
          4        FREE                                                     ~5
          5      > JMP                                                      ->11
   19     6  E > > CATCH                                       last         'Error'
   20     7    >   INIT_METHOD_CALL                                         !1, 'getMessage'
          8        DO_FCALL                                      0  $6      
          9        CONCAT                                           ~7      $6, '%0A'
         10        ECHO                                                     ~7
   24    11    >   UNSET_OBJ                                                !0, 'name'
   26    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~8      !0, 'name'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
         16      > JMP                                                      ->22
   27    17  E > > CATCH                                       last         'Error'
   28    18    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         19        DO_FCALL                                      0  $10     
         20        CONCAT                                           ~11     $10, '%0A'
         21        ECHO                                                     ~11
   31    22    >   INIT_FCALL                                               'var_dump'
         23        FETCH_OBJ_R                                      ~12     !0, 'name'
         24        SEND_VAL                                                 ~12
         25        DO_ICALL                                                 
         26      > JMP                                                      ->32
   32    27  E > > CATCH                                       last         'Error'
   33    28    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         29        DO_FCALL                                      0  $14     
         30        CONCAT                                           ~15     $14, '%0A'
         31        ECHO                                                     ~15
   34    32    > > RETURN                                                   1

Class Cl:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6RlfS
function name:  __get
number of ops:  9
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        CONCAT                                           ~1      '__get%3A+', !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   10     5        NEW                                              $3      'stdClass'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   $3
   11     8*     > RETURN                                                   null

End of function __get

End of class Cl.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.16 ms | 1015 KiB | 14 Q