3v4l.org

run code in 300+ PHP versions simultaneously
<?php $output = ""; $output['blah'] = array( ); var_dump($output);//"A" but why? 'blah' casts to 0, OK, but 'A'? //because: var_dump(((string)array() )[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aSj6s
function name:  (null)
number of ops:  12
compiled vars:  !0 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    4     1        ASSIGN_DIM                                               !0, 'blah'
    6     2        OP_DATA                                                  <array>
    8     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   29     6        INIT_FCALL                                               'var_dump'
          7        CAST                                          6  ~4      <array>
          8        FETCH_DIM_R                                      ~5      ~4, 0
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.48 ms | 1398 KiB | 15 Q