3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "array ( 2 => 'authenticated user, 6 => employee',)"; eval('$foo = $string;'); print_r($foo); echo var_export(array(2 => 'authenticated user', 6 => 'employee',), TRUE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/psRNE
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'array+%28+2+%3D%3E+%27authenticated+user%2C+6+%3D%3E+employee%27%2C%29'
    4     1        INCLUDE_OR_EVAL                                          '%24foo+%3D+%24string%3B', EVAL
    5     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
    6     5        INIT_FCALL                                               'var_export'
          6        SEND_VAL                                                 <array>
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.77 ms | 1394 KiB | 17 Q