3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @property int $id * @property string $text */ class Foo { var $id; var $text; public function __get($name) { $methodName = 'get' . ucfirst($name); return method_exists($this, $methodName) ? $this->{$methodName}() : $this->{$name}; } public function __set($name, $value) { $methodName = 'set' . ucfirst($name); return method_exists($this, $methodName) ? $this->{$methodName}($value) : $this->{$name} = $value; } public function __isset($name) { return property_exists($this, $name); } public function setText($text) { $this->text = $text . ' World!'; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gia9X
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E > > RETURN                                                   1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gia9X
function name:  __get
number of ops:  20
compiled vars:  !0 = $name, !1 = $methodName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'ucfirst'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      'get', $2
          5        ASSIGN                                                   !1, ~3
   15     6        INIT_FCALL                                               'method_exists'
          7        FETCH_THIS                                       ~5      
          8        SEND_VAL                                                 ~5
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11      > JMPZ                                                     $6, ->16
         12    >   INIT_METHOD_CALL                                         !1
         13        DO_FCALL                                      0  $7      
         14        QM_ASSIGN                                        ~8      $7
         15      > JMP                                                      ->18
         16    >   FETCH_OBJ_R                                      ~9      !0
         17        QM_ASSIGN                                        ~8      ~9
         18    > > RETURN                                                   ~8
   16    19*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gia9X
function name:  __set
number of ops:  23
compiled vars:  !0 = $name, !1 = $value, !2 = $methodName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        INIT_FCALL                                               'ucfirst'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        CONCAT                                           ~4      'set', $3
          6        ASSIGN                                                   !2, ~4
   21     7        INIT_FCALL                                               'method_exists'
          8        FETCH_THIS                                       ~6      
          9        SEND_VAL                                                 ~6
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $7      
         12      > JMPZ                                                     $7, ->18
         13    >   INIT_METHOD_CALL                                         !2
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $8      
         16        QM_ASSIGN                                        ~9      $8
         17      > JMP                                                      ->21
         18    >   ASSIGN_OBJ                                       ~10     !0
         19        OP_DATA                                                  !1
         20        QM_ASSIGN                                        ~9      ~10
         21    > > RETURN                                                   ~9
   22    22*     > RETURN                                                   null

End of function __set

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gia9X
function name:  __isset
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   26     1        INIT_FCALL                                               'property_exists'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   27     7*     > RETURN                                                   null

End of function __isset

Function settext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gia9X
function name:  setText
number of ops:  5
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        CONCAT                                           ~2      !0, '+World%21'
          2        ASSIGN_OBJ                                               'text'
          3        OP_DATA                                                  ~2
   32     4      > RETURN                                                   null

End of function settext

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.21 ms | 1400 KiB | 19 Q