3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __get($var) { if ($var === 'foo') { return 'bar!'; } return null; } } $fooInst = new Foo(); $empty = empty($fooInst->foo) ? "empty" : "not empty"; print "direct call: $empty \n"; $val = $fooInst->foo; $empty = empty($val) ? "empty" : "not empty"; print "indirect call: $empty\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
Branch analysis from position: 19
filename:       /in/qRZOX
function name:  (null)
number of ops:  26
compiled vars:  !0 = $fooInst, !1 = $empty, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   12     3        ISSET_ISEMPTY_PROP_OBJ                                   !0, 'foo'
          4      > JMPZ                                                     ~6, ->7
          5    >   QM_ASSIGN                                        ~7      'empty'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~7      'not+empty'
          8    >   ASSIGN                                                   !1, ~7
   14     9        ROPE_INIT                                     3  ~10     'direct+call%3A+'
         10        ROPE_ADD                                      1  ~10     ~10, !1
         11        ROPE_END                                      2  ~9      ~10, '+%0A'
         12        ECHO                                                     ~9
   16    13        FETCH_OBJ_R                                      ~12     !0, 'foo'
         14        ASSIGN                                                   !2, ~12
   18    15        ISSET_ISEMPTY_CV                                         !2
         16      > JMPZ                                                     ~14, ->19
         17    >   QM_ASSIGN                                        ~15     'empty'
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~15     'not+empty'
         20    >   ASSIGN                                                   !1, ~15
   20    21        ROPE_INIT                                     3  ~18     'indirect+call%3A+'
         22        ROPE_ADD                                      1  ~18     ~18, !1
         23        ROPE_END                                      2  ~17     ~18, '%0A'
         24        ECHO                                                     ~17
         25      > RETURN                                                   1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qRZOX
function name:  __get
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_IDENTICAL                                             !0, 'foo'
          2      > JMPZ                                                     ~1, ->4
    5     3    > > RETURN                                                   'bar%21'
    7     4    > > RETURN                                                   null
    8     5*     > RETURN                                                   null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.3 ms | 1399 KiB | 13 Q