3v4l.org

run code in 500+ PHP versions simultaneously
<?php #[AllowDynamicProperties] class Scratch_1 { } $new = new Scratch_1(); $prop = 'Content-Type'; $new->$prop = 'application/json'; var_dump($new->$prop); // string(16) "application/json" var_dump($new->{'Content-Type'}); $$prop = 'application/json'; var_dump($$prop); // string(16) "application/json" $prop = '10xl'; $new->$prop = '10xl'; var_dump($new->$prop); // string(3) "10xl" var_dump($new); var_dump(get_defined_vars()['Content-Type']); var_dump(${"Content-Type"});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFBeV
function name:  (null)
number of ops:  40
compiled vars:  !0 = $new, !1 = $prop, !2 = $Content-Type
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $3      'Scratch_1'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
    8     3        ASSIGN                                                       !1, 'Content-Type'
   10     4        ASSIGN_OBJ                                                   !0, !1
          5        OP_DATA                                                      'application%2Fjson'
   12     6        INIT_FCALL                                                   'var_dump'
          7        FETCH_OBJ_R                                          ~8      !0, !1
          8        SEND_VAL                                                     ~8
          9        DO_ICALL                                                     
   13    10        INIT_FCALL                                                   'var_dump'
         11        FETCH_OBJ_R                                          ~10     !0, 'Content-Type'
         12        SEND_VAL                                                     ~10
         13        DO_ICALL                                                     
   15    14        FETCH_W                          local               $12     !1
         15        ASSIGN                                                       $12, 'application%2Fjson'
   16    16        INIT_FCALL                                                   'var_dump'
         17        FETCH_R                          local               ~14     !1
         18        SEND_VAL                                                     ~14
         19        DO_ICALL                                                     
   18    20        ASSIGN                                                       !1, '10xl'
   19    21        ASSIGN_OBJ                                                   !0, !1
         22        OP_DATA                                                      '10xl'
   21    23        INIT_FCALL                                                   'var_dump'
         24        FETCH_OBJ_R                                          ~18     !0, !1
         25        SEND_VAL                                                     ~18
         26        DO_ICALL                                                     
   23    27        INIT_FCALL                                                   'var_dump'
         28        SEND_VAR                                                     !0
         29        DO_ICALL                                                     
   24    30        INIT_FCALL                                                   'var_dump'
         31        INIT_FCALL                                                   'get_defined_vars'
         32        DO_ICALL                                             $21     
         33        FETCH_DIM_R                                          ~22     $21, 'Content-Type'
         34        SEND_VAL                                                     ~22
         35        DO_ICALL                                                     
   26    36        INIT_FCALL                                                   'var_dump'
         37        SEND_VAR                                                     !2
         38        DO_ICALL                                                     
         39      > RETURN                                                       1

Class Scratch_1: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.66 ms | 1620 KiB | 15 Q