3v4l.org

run code in 300+ PHP versions simultaneously
<?php class entity { var $body = array ('en' => "This is english", 'fr' => "C'est français"); }; $entity = new entity(); $field_name = "body"; $langcode = "en"; echo $entity->$field_name[$langcode];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HZ9OR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $entity, !1 = $field_name, !2 = $langcode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'entity'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    8     3        ASSIGN                                                   !1, 'body'
    9     4        ASSIGN                                                   !2, 'en'
   10     5        FETCH_OBJ_R                                      ~8      !0, !1
          6        FETCH_DIM_R                                      ~9      ~8, !2
          7        ECHO                                                     ~9
          8      > RETURN                                                   1

Class entity: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.02 ms | 1397 KiB | 13 Q