3v4l.org

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

Generated using Vulcan Logic Dumper, using php 7.2.0