3v4l.org

run code in 500+ PHP versions simultaneously
<?php $code = 'enum Mega {'; for ($i = 0; $i < 60_000; ++$i) { $code .= "case C{$i};"; } $code .= '}'; eval($code); unset($code); var_dump(memory_get_usage() / 1024 / 1024); for ($i = 0; $i < 60_000; ++$i) { constant("Mega::C{$i}"); } var_dump(memory_get_usage() / 1024 / 1024);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 22
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 22
Branch analysis from position: 30
Branch analysis from position: 22
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/tOI8G
function name:  (null)
number of ops:  38
compiled vars:  !0 = $code, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'enum+Mega+%7B'
    4     1        ASSIGN                                                       !1, 0
          2      > JMP                                                          ->8
    5     3    >   ROPE_INIT                                         3  ~5      'case+C'
          4        ROPE_ADD                                          1  ~5      ~5, !1
          5        ROPE_END                                          2  ~4      ~5, '%3B'
          6        ASSIGN_OP                                         8          !0, ~4
    4     7        PRE_INC                                                      !1
          8    >   IS_SMALLER                                                   !1, 60000
          9      > JMPNZ                                                        ~9, ->3
    7    10    >   ASSIGN_OP                                         8          !0, '%7D'
    8    11        INCLUDE_OR_EVAL                                              !0, EVAL
    9    12        UNSET_CV                                                     !0
   11    13        INIT_FCALL                                                   'var_dump'
         14        INIT_FCALL                                                   'memory_get_usage'
         15        DO_ICALL                                             $12     
         16        DIV                                                  ~13     $12, 1024
         17        DIV                                                  ~14     ~13, 1024
         18        SEND_VAL                                                     ~14
         19        DO_ICALL                                                     
   13    20        ASSIGN                                                       !1, 0
         21      > JMP                                                          ->28
   14    22    >   INIT_FCALL                                                   'constant'
         23        NOP                                                          
         24        FAST_CONCAT                                          ~17     'Mega%3A%3AC', !1
         25        SEND_VAL                                                     ~17
         26        DO_ICALL                                                     
   13    27        PRE_INC                                                      !1
         28    >   IS_SMALLER                                                   !1, 60000
         29      > JMPNZ                                                        ~20, ->22
   17    30    >   INIT_FCALL                                                   'var_dump'
         31        INIT_FCALL                                                   'memory_get_usage'
         32        DO_ICALL                                             $21     
         33        DIV                                                  ~22     $21, 1024
         34        DIV                                                  ~23     ~22, 1024
         35        SEND_VAL                                                     ~23
         36        DO_ICALL                                                     
         37      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.68 ms | 485 KiB | 10 Q