3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar = 42; } $obj = new foo; $propname="\0foo\0bar"; $a = (array) $obj; $a[$propname] = 43; echo $a[$propname];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2q7al
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj, !1 = $propname, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $3      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    6     3        ASSIGN                                                   !1, '%00foo%00bar'
    7     4        CAST                                          7  ~7      !0
          5        ASSIGN                                                   !2, ~7
    8     6        ASSIGN_DIM                                               !2, !1
          7        OP_DATA                                                  43
    9     8        FETCH_DIM_R                                      ~10     !2, !1
          9        ECHO                                                     ~10
         10      > RETURN                                                   1

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.27 ms | 1397 KiB | 13 Q