3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __get($name) { echo __METHOD__ . "($name)" . PHP_EOL; switch ($name) { case 'foo': return new Foo(); case 'bar': return 'bar'; default: return null; } } public function __isset($name) { echo __METHOD__ . "($name)" . PHP_EOL; return $name === 'bar'; } } $foo = new Foo(); echo (empty($foo->foo->bar) ? 'is empty' : 'is not empty') . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2Xqr
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   19     3        FETCH_OBJ_IS                                         ~4      !0, 'foo'
          4        ISSET_ISEMPTY_PROP_OBJ                                       ~4, 'bar'
          5      > JMPZ                                                         ~5, ->8
          6    >   QM_ASSIGN                                            ~6      'is+empty'
          7      > JMP                                                          ->9
          8    >   QM_ASSIGN                                            ~6      'is+not+empty'
          9    >   CONCAT                                               ~7      ~6, '%0A'
         10        ECHO                                                         ~7
   20    11      > RETURN                                                       1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 13, Position 2 = 16, Position 3 = 17, Position 4 = 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 16
Branch analysis from position: 13
filename:       /in/c2Xqr
function name:  __get
number of ops:  19
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ROPE_INIT                                         3  ~2      '%28'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%29'
          4        CONCAT                                               ~4      'Foo%3A%3A__get', ~1
          5        CONCAT                                               ~5      ~4, '%0A'
          6        ECHO                                                         ~5
    5     7      > SWITCH_STRING                                                !0, [ 'foo':->13, 'bar':->16, ], ->17
    6     8    >   IS_EQUAL                                                     !0, 'foo'
          9      > JMPNZ                                                        ~6, ->13
    7    10    >   IS_EQUAL                                                     !0, 'bar'
         11      > JMPNZ                                                        ~6, ->16
         12    > > JMP                                                          ->17
    6    13    >   NEW                                                  $7      'Foo'
         14        DO_FCALL                                          0          
         15      > RETURN                                                       $7
    7    16    > > RETURN                                                       'bar'
    8    17    > > RETURN                                                       null
   10    18*     > 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/c2Xqr
function name:  __isset
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        ROPE_INIT                                         3  ~2      '%28'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%29'
          4        CONCAT                                               ~4      'Foo%3A%3A__isset', ~1
          5        CONCAT                                               ~5      ~4, '%0A'
          6        ECHO                                                         ~5
   14     7        IS_IDENTICAL                                         ~6      !0, 'bar'
          8      > RETURN                                                       ~6
   15     9*     > RETURN                                                       null

End of function __isset

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.55 ms | 3264 KiB | 13 Q