3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const BAR = 'fubar' ; function __get($name) { if ($name == 'BAR') { return 'bob'; } } } $a = new Foo(); echo $a::BAR;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fWIbR
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        FETCH_CLASS                                   0  $4      !0
          4        FETCH_CLASS_CONSTANT                             ~5      $4, 'BAR'
          5        ECHO                                                     ~5
          6      > 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/fWIbR
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        IS_EQUAL                                                 !0, 'BAR'
          2      > JMPZ                                                     ~1, ->4
    9     3    > > RETURN                                                   'bob'
   11     4    > > RETURN                                                   null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.68 ms | 1393 KiB | 13 Q