3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Liquid { } class Juice extends Liquid { protected $apple; protected $orange; public function __construct($apple, $orange) { $this->apple = $apple; $this->orange = $orange; } public function __get($name) { return $this->$name; } public function __isset($name) { return $name == "apple" || $name == "orange"; } } class Glass { protected $liquid; public function __construct() { $this->liquid = new Juice(3, 5); } public function __get($name) { return $name == "liquid" ? $this->liquid : false; } public function __isset($name) { return $name == "liquid"; } } $glass = new Glass(); var_dump(empty($glass->liquid)); var_dump(empty($glass->liquid->apple)); var_dump(empty(($glass->liquid->apple)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qaeJL
function name:  (null)
number of ops:  18
compiled vars:  !0 = $glass
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   43     0  E >   NEW                                                  $1      'Glass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   44     3        INIT_FCALL                                                   'var_dump'
          4        ISSET_ISEMPTY_PROP_OBJ                               ~4      !0, 'liquid'
          5        SEND_VAL                                                     ~4
          6        DO_ICALL                                                     
   45     7        INIT_FCALL                                                   'var_dump'
          8        FETCH_OBJ_IS                                         ~6      !0, 'liquid'
          9        ISSET_ISEMPTY_PROP_OBJ                               ~7      ~6, 'apple'
         10        SEND_VAL                                                     ~7
         11        DO_ICALL                                                     
   46    12        INIT_FCALL                                                   'var_dump'
         13        FETCH_OBJ_IS                                         ~9      !0, 'liquid'
         14        ISSET_ISEMPTY_PROP_OBJ                               ~10     ~9, 'apple'
         15        SEND_VAL                                                     ~10
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Class Liquid: [no user functions]
Class Juice:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qaeJL
function name:  __construct
number of ops:  7
compiled vars:  !0 = $apple, !1 = $orange
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   11     2        ASSIGN_OBJ                                                   'apple'
          3        OP_DATA                                                      !0
   12     4        ASSIGN_OBJ                                                   'orange'
          5        OP_DATA                                                      !1
   13     6      > 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/qaeJL
function name:  __get
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   16     1        FETCH_OBJ_R                                          ~1      !0
          2      > RETURN                                                       ~1
   17     3*     > RETURN                                                       null

End of function __get

Function __isset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/qaeJL
function name:  __isset
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
   20     1        IS_EQUAL                                             ~1      !0, 'apple'
          2      > JMPNZ_EX                                             ~1      ~1, ->5
          3    >   IS_EQUAL                                             ~2      !0, 'orange'
          4        BOOL                                                 ~1      ~2
          5    > > RETURN                                                       ~1
   21     6*     > RETURN                                                       null

End of function __isset

End of class Juice.

Class Glass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qaeJL
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   NEW                                                  $1      'Juice'
          1        SEND_VAL_EX                                                  3
          2        SEND_VAL_EX                                                  5
          3        DO_FCALL                                          0          
          4        ASSIGN_OBJ                                                   'liquid'
          5        OP_DATA                                                      $1
   31     6      > RETURN                                                       null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qaeJL
function name:  __get
number of ops:  9
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   RECV                                                 !0      
   34     1        IS_EQUAL                                                     !0, 'liquid'
          2      > JMPZ                                                         ~1, ->6
          3    >   FETCH_OBJ_R                                          ~2      'liquid'
          4        QM_ASSIGN                                            ~3      ~2
          5      > JMP                                                          ->7
          6    >   QM_ASSIGN                                            ~3      <false>
          7    > > RETURN                                                       ~3
   35     8*     > 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/qaeJL
function name:  __isset
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   37     0  E >   RECV                                                 !0      
   38     1        IS_EQUAL                                             ~1      !0, 'liquid'
          2      > RETURN                                                       ~1
   39     3*     > RETURN                                                       null

End of function __isset

End of class Glass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.42 ms | 482 KiB | 8 Q