3v4l.org

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

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