3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = []; $a[1] = 1; $a["1"] = 2; var_dump($a); $obj = new stdClass; $obj->{1} = 1; $obj->{"1"} = 2; var_dump($obj); $a2 = (array)$obj; var_dump($a2);
based on Qs0kl
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/huS2n
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $obj, !2 = $a2
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   4     1        ASSIGN_DIM                                               !0, 1
         2        OP_DATA                                                  1
   5     3        ASSIGN_DIM                                               !0, 1
         4        OP_DATA                                                  2
   7     5        INIT_FCALL                                               'var_dump'
         6        SEND_VAR                                                 !0
         7        DO_ICALL                                                 
   9     8        NEW                                              $7      :0
         9        DO_FCALL                                      0          
        10        ASSIGN                                                   !1, $7
  10    11        ASSIGN_OBJ                                               !1, '1'
        12        OP_DATA                                                  1
  11    13        ASSIGN_OBJ                                               !1, '1'
        14        OP_DATA                                                  2
  13    15        INIT_FCALL                                               'var_dump'
        16        SEND_VAR                                                 !1
        17        DO_ICALL                                                 
  15    18        CAST                                          7  ~13     !1
        19        ASSIGN                                                   !2, ~13
  16    20        INIT_FCALL                                               'var_dump'
        21        SEND_VAR                                                 !2
        22        DO_ICALL                                                 
        23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0