3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = (object)array('1' => 'Object one','2' => 'Object two'); var_dump($var); $var = json_decode(json_encode(array('1' => 'Object one','2' => 'Object two'))); var_dump($var); $num = "2"; var_dump( $var->{$num} );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YU2Fo
function name:  (null)
number of ops:  21
compiled vars:  !0 = $var, !1 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          8  ~2      <array>
          1        ASSIGN                                                   !0, ~2
    4     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5        INIT_FCALL                                               'json_decode'
          6        INIT_FCALL                                               'json_encode'
          7        SEND_VAL                                                 <array>
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !0, $6
    7    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
    9    15        ASSIGN                                                   !1, '2'
   10    16        INIT_FCALL                                               'var_dump'
         17        FETCH_OBJ_R                                      ~10     !0, !1
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.38 ms | 999 KiB | 16 Q