3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar = 42; } $obj = new foo; $propname="\0foo\0bar"; $a = (array) $obj; var_dump($a['foobar']); echo $a[$propname];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KhFEl
function name:  (null)
number of ops:  13
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        INIT_FCALL                                               'var_dump'
          7        FETCH_DIM_R                                      ~9      !2, 'foobar'
          8        SEND_VAL                                                 ~9
          9        DO_ICALL                                                 
    9    10        FETCH_DIM_R                                      ~11     !2, !1
         11        ECHO                                                     ~11
         12      > RETURN                                                   1

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.98 ms | 1394 KiB | 15 Q