3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __get($name) { $pos = strpos($name, '#'); if ($pos !== false && $pos != 0 ) { $func = substr($name, 0, $pos); return $this->$func(); } else { return $name; } } private function a() { return "f:a"; } } $a = new A(); echo $a->a; $p = "a#a"; echo $a->$p;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Glav
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        FETCH_OBJ_R                                      ~5      !0, 'a'
          4        ECHO                                                     ~5
   21     5        ASSIGN                                                   !1, 'a%23a'
   22     6        FETCH_OBJ_R                                      ~7      !0, !1
          7        ECHO                                                     ~7
          8      > RETURN                                                   1

Class A:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/8Glav
function name:  __get
number of ops:  23
compiled vars:  !0 = $name, !1 = $pos, !2 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%23'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    6     6        TYPE_CHECK                                  1018  ~5      !1
          7      > JMPZ_EX                                          ~5      ~5, ->10
          8    >   IS_NOT_EQUAL                                     ~6      !1, 0
          9        BOOL                                             ~5      ~6
         10    > > JMPZ                                                     ~5, ->21
    7    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $7      
         16        ASSIGN                                                   !2, $7
    8    17        INIT_METHOD_CALL                                         !2
         18        DO_FCALL                                      0  $9      
         19      > RETURN                                                   $9
         20*       JMP                                                      ->22
   10    21    > > RETURN                                                   !0
   12    22*     > RETURN                                                   null

End of function __get

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Glav
function name:  a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   'f%3Aa'
   16     1*     > RETURN                                                   null

End of function a

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.73 ms | 1392 KiB | 17 Q