3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', '64M'); define('N', 100); register_shutdown_function(function() { global $max; ini_set('memory_limit', '256M'); $y = []; for ($i = 0; $i < N; $i++) { var_dump($i); $y[] = str_repeat('asdf', $max); } var_dump('end'); }); $x = array_fill(0, N, ''); $max = 0; $i = 0; while (true) { $x[$i] .= 'asdf'; if (++$i >= N) { $i = 0; $max++; } }

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 22
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 22
Branch analysis from position: 31
Branch analysis from position: 22
Branch analysis from position: 30
filename:       /in/Ug1pq
function name:  (null)
number of ops:  32
compiled vars:  !0 = $x, !1 = $max, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'memory_limit'
          2        SEND_VAL                                                 '64M'
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'N'
          6        SEND_VAL                                                 100
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'register_shutdown_function'
          9        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
   20    10        SEND_VAL                                                 ~5
    7    11        DO_ICALL                                                 
   22    12        INIT_FCALL                                               'array_fill'
         13        SEND_VAL                                                 0
         14        FETCH_CONSTANT                                   ~7      'N'
         15        SEND_VAL                                                 ~7
         16        SEND_VAL                                                 ''
         17        DO_ICALL                                         $8      
         18        ASSIGN                                                   !0, $8
   24    19        ASSIGN                                                   !1, 0
   25    20        ASSIGN                                                   !2, 0
   27    21      > JMP                                                      ->30
   29    22    >   ASSIGN_DIM_OP                .=               8          !0, !2
         23        OP_DATA                                                  'asdf'
   31    24        PRE_INC                                          ~13     !2
         25        FETCH_CONSTANT                                   ~14     'N'
         26        IS_SMALLER_OR_EQUAL                                      ~14, ~13
         27      > JMPZ                                                     ~15, ->30
   33    28    >   ASSIGN                                                   !2, 0
   34    29        PRE_INC                                                  !1
   27    30    > > JMPNZ                                                    <true>, ->22
   36    31    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 8
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 8
Branch analysis from position: 21
Branch analysis from position: 8
filename:       /in/Ug1pq
function name:  {closure}
number of ops:  25
compiled vars:  !0 = $max, !1 = $y, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_GLOBAL                                              !0, 'max'
    9     1        INIT_FCALL                                               'ini_set'
          2        SEND_VAL                                                 'memory_limit'
          3        SEND_VAL                                                 '256M'
          4        DO_ICALL                                                 
   12     5        ASSIGN                                                   !1, <array>
   13     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->18
   15     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   16    11        INIT_FCALL                                               'str_repeat'
         12        SEND_VAL                                                 'asdf'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $8      
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  $8
   13    17        PRE_INC                                                  !2
         18    >   FETCH_CONSTANT                                   ~10     'N'
         19        IS_SMALLER                                               !2, ~10
         20      > JMPNZ                                                    ~11, ->8
   19    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAL                                                 'end'
         23        DO_ICALL                                                 
   20    24      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.19 ms | 1464 KiB | 19 Q