3v4l.org

run code in 300+ PHP versions simultaneously
<?php class evil { public function __toString() { global $array; $array[] = 1; $array[] = 1; $array[] = 1; $array[] = 1; return "okey"; } } $array = range(0, 5); $array[1] .= new evil; var_dump($array[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KVukc
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'evil'
   14     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 5
          4        DO_ICALL                                         $1      
          5        ASSIGN                                                   !0, $1
   16     6        NEW                                              $4      'evil'
          7        DO_FCALL                                      0          
          8        ASSIGN_DIM_OP                .=               8          !0, 1
          9        OP_DATA                                                  $4
   17    10        INIT_FCALL                                               'var_dump'
         11        FETCH_DIM_R                                      ~6      !0, 1
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class evil:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KVukc
function name:  __toString
number of ops:  12
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                              !0, 'array'
    6     1        ASSIGN_DIM                                               !0
          2        OP_DATA                                                  1
    7     3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  1
    8     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  1
    9     7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  1
   10     9      > RETURN                                                   'okey'
   11    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function __tostring

End of class evil.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.13 ms | 1395 KiB | 17 Q