3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends \ReflectionClass { public function get($name) { if ('name' === $name) { return 'bla'; } return $this->$name; } } $r = new A('stdClass'); var_dump($r->name);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V2MiC
function name:  (null)
number of ops:  9
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   17     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~4      !0, 'name'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class A:
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/V2MiC
function name:  get
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        IS_IDENTICAL                                             !0, 'name'
          2      > JMPZ                                                     ~1, ->4
    8     3    > > RETURN                                                   'bla'
   11     4    >   FETCH_OBJ_R                                      ~2      !0
          5      > RETURN                                                   ~2
   12     6*     > RETURN                                                   null

End of function get

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.11 ms | 1395 KiB | 15 Q