3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Cl { public string $name; public function __get(string $n) { var_dump('__get: ' . $n); return 5; } } $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/O9prE
function name:  (null)
number of ops:  33
compiled vars:  !0 = $obj, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'Cl'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        FETCH_OBJ_R                                      ~5      !0, 'name'
          4        FREE                                                     ~5
          5      > JMP                                                      ->11
   21     6  E > > CATCH                                       last         'Error'
   22     7    >   INIT_METHOD_CALL                                         !1, 'getMessage'
          8        DO_FCALL                                      0  $6      
          9        CONCAT                                           ~7      $6, '%0A'
         10        ECHO                                                     ~7
   26    11    >   UNSET_OBJ                                                !0, 'name'
   28    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~8      !0, 'name'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
         16      > JMP                                                      ->22
   29    17  E > > CATCH                                       last         'Error'
   30    18    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         19        DO_FCALL                                      0  $10     
         20        CONCAT                                           ~11     $10, '%0A'
         21        ECHO                                                     ~11
   33    22    >   INIT_FCALL                                               'var_dump'
         23        FETCH_OBJ_R                                      ~12     !0, 'name'
         24        SEND_VAL                                                 ~12
         25        DO_ICALL                                                 
         26      > JMP                                                      ->32
   34    27  E > > CATCH                                       last         'Error'
   35    28    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         29        DO_FCALL                                      0  $14     
         30        CONCAT                                           ~15     $14, '%0A'
         31        ECHO                                                     ~15
   36    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/O9prE
function name:  __get
number of ops:  7
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'var_dump'
          2        CONCAT                                           ~1      '__get%3A+', !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   12     5      > RETURN                                                   5
   13     6*     > RETURN                                                   null

End of function __get

End of class Cl.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
124.82 ms | 1015 KiB | 14 Q