3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NoIsset { public $data; public function __construct(array $data) { $this->data = $data; } public function __get($name) { return $this->data[$name]; } } class HasIsset extends NoIsset { public function __isset($name) { return isset($this->data[$name]); } } $data = array('one' => 1, 'two' => 2, 'three' => 3); $no_isset = new NoIsset($data); $has_isset = new HasIsset($data); if (empty($no_isset->one)) echo "NoIsset doesn't have one\n"; else echo "NoIsset has one\n"; if (empty($has_isset->one)) echo "HasIsset doesn't have one\n"; else echo "HasIsset has one\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Branch analysis from position: 18
filename:       /in/LvJO0
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $no_isset, !2 = $has_isset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ASSIGN                                                   !0, <array>
   27     1        NEW                                              $4      'NoIsset'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   28     5        NEW                                              $7      'HasIsset'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $7
   30     9        ISSET_ISEMPTY_PROP_OBJ                                   !1, 'one'
         10      > JMPZ                                                     ~10, ->13
   31    11    >   ECHO                                                     'NoIsset+doesn%27t+have+one%0A'
         12      > JMP                                                      ->14
   33    13    >   ECHO                                                     'NoIsset+has+one%0A'
   35    14    >   ISSET_ISEMPTY_PROP_OBJ                                   !2, 'one'
         15      > JMPZ                                                     ~11, ->18
   36    16    >   ECHO                                                     'HasIsset+doesn%27t+have+one%0A'
         17      > JMP                                                      ->19
   38    18    >   ECHO                                                     'HasIsset+has+one%0A'
         19    > > RETURN                                                   1

Class NoIsset:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LvJO0
function name:  __construct
number of ops:  4
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'data'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LvJO0
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_OBJ_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   15     4*     > RETURN                                                   null

End of function __get

End of class NoIsset.

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

End of function __isset

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LvJO0
function name:  __construct
number of ops:  4
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'data'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LvJO0
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_OBJ_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   15     4*     > RETURN                                                   null

End of function __get

End of class HasIsset.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.18 ms | 1399 KiB | 13 Q