3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('FIELD_NAME',"foo"); class A { public $foo = 'foo'; } $a = new A(); echo $a->{FIELD_NAME};
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sgvV4
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'FIELD_NAME'
          2        SEND_VAL                                                 'foo'
          3        DO_ICALL                                                 
   10     4        NEW                                              $2      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   11     7        FETCH_CONSTANT                                   ~5      'FIELD_NAME'
          8        FETCH_OBJ_R                                      ~6      !0, ~5
          9        ECHO                                                     ~6
         10      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.53 ms | 1450 KiB | 14 Q