3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Regular { public $test = 'value'; } class Magic { private $values = ['test' => 'value']; public function __get($key) { if (isset($this->values[$key])) { return $this->values[$key]; } } public function __isset($key) { return isset($this->values[$key]); } } var_dump(empty($regular->nope)); // outputs bool(false) var_dump(empty($magic->nope)); // outputs bool(true)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANJrK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $regular, !1 = $magic
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_PROP_OBJ                           ~2      !0, 'nope'
          2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   25     4        INIT_FCALL                                               'var_dump'
          5        ISSET_ISEMPTY_PROP_OBJ                           ~4      !1, 'nope'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Regular: [no user functions]
Class Magic:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANJrK
function name:  __get
number of ops:  8
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_IS                                     ~1      'values'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          3      > JMPZ                                                     ~2, ->7
   14     4    >   FETCH_OBJ_R                                      ~3      'values'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6      > RETURN                                                   ~4
   16     7    > > RETURN                                                   null

End of function __get

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANJrK
function name:  __isset
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_IS                                     ~1      'values'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3      > RETURN                                                   ~2
   21     4*     > RETURN                                                   null

End of function __isset

End of class Magic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.67 ms | 1396 KiB | 15 Q