3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { protected string $foo; public function __isset($name) { echo "__isset called\n"; // This is the same like in line 22. So why it doesn't call __isset() again if (!isset($this->foo)) { return true; }; return false; } public function test_isset() { var_dump(isset($this->foo)); // Is false always unset($this->foo); var_dump(isset($this->foo)); // This should be false, but it calls __isset(). } } (new X())->test_isset();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y3B7F
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $0      'X'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'test_isset'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Class X:
Function __isset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y3B7F
function name:  __isset
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        ECHO                                                         '__isset+called%0A'
   12     2        ISSET_ISEMPTY_PROP_OBJ                               ~1      'foo'
          3        BOOL_NOT                                             ~2      ~1
          4      > JMPZ                                                         ~2, ->6
   13     5    > > RETURN                                                       <true>
   15     6    > > RETURN                                                       <false>
   16     7*     > RETURN                                                       null

End of function __isset

Function test_isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y3B7F
function name:  test_isset
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                                   'var_dump'
          1        ISSET_ISEMPTY_PROP_OBJ                               ~0      'foo'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                                     
   21     4        UNSET_OBJ                                                    'foo'
   22     5        INIT_FCALL                                                   'var_dump'
          6        ISSET_ISEMPTY_PROP_OBJ                               ~2      'foo'
          7        SEND_VAL                                                     ~2
          8        DO_ICALL                                                     
   23     9      > RETURN                                                       null

End of function test_isset

End of class X.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.59 ms | 1356 KiB | 14 Q