3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cl { public string $name; public function __get(string $n): void { var_dump('__get: ' . $n); } } $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 { $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 = 20
Branch analysis from position: 20
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 = 20
Branch analysis from position: 20
Found catch point at position: 15
Branch analysis from position: 15
2 jumps found. (Code = 107) Position 1 = 16, Position 2 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lDeXi
function name:  (null)
number of ops:  21
compiled vars:  !0 = $obj, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'Cl'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        FETCH_OBJ_R                                      ~5      !0, 'name'
          4        FREE                                                     ~5
          5      > JMP                                                      ->11
   17     6  E > > CATCH                                       last         'Error'
   18     7    >   INIT_METHOD_CALL                                         !1, 'getMessage'
          8        DO_FCALL                                      0  $6      
          9        CONCAT                                           ~7      $6, '%0A'
         10        ECHO                                                     ~7
   22    11    >   UNSET_OBJ                                                !0, 'name'
   24    12        FETCH_OBJ_R                                      ~8      !0, 'name'
         13        FREE                                                     ~8
         14      > JMP                                                      ->20
   25    15  E > > CATCH                                       last         'Error'
   26    16    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         17        DO_FCALL                                      0  $9      
         18        CONCAT                                           ~10     $9, '%0A'
         19        ECHO                                                     ~10
   27    20    > > RETURN                                                   1

Class Cl:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lDeXi
function name:  __get
number of ops:  6
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                                                 
    9     5      > RETURN                                                   null

End of function __get

End of class Cl.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.96 ms | 1003 KiB | 14 Q