3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public ?int $v = 123; } $x = new C; unset($x->v); $y = new C; $y->v = null; function propertyWasUnset($object, $propertyName) { try { $object->{$propertyName}; return true; } catch (\Error $e) { return false; } } var_dump(propertyWasUnset($x, 'v')); var_dump(propertyWasUnset($y, 'v'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7NL0Y
function name:  (null)
number of ops:  24
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
          3        UNSET_OBJ                                                !0, 'v'
    8     4        NEW                                              $5      'C'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
          7        ASSIGN_OBJ                                               !1, 'v'
          8        OP_DATA                                                  null
   19     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'propertywasunset'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 'v'
         13        DO_FCALL                                      0  $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                                 
   20    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'propertywasunset'
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 'v'
         20        DO_FCALL                                      0  $11     
         21        SEND_VAR                                                 $11
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function propertywasunset:
Finding entry points
Branch analysis from position: 0
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 = 62) Position 1 = -2
filename:       /in/7NL0Y
function name:  propertyWasUnset
number of ops:  9
compiled vars:  !0 = $object, !1 = $propertyName, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        FETCH_OBJ_R                                      ~3      !0, !1
          3        FREE                                                     ~3
   13     4      > RETURN                                                   <true>
          5*       JMP                                                      ->8
   14     6  E > > CATCH                                       last         'Error'
   15     7    > > RETURN                                                   <false>
   17     8*     > RETURN                                                   null

End of function propertywasunset

Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.82 ms | 1403 KiB | 17 Q