3v4l.org

run code in 300+ PHP versions simultaneously
<?php //ini_set('memory_limit', '1M'); register_shutdown_function(function(){ echo "SHUTDOWN"; echo PHP_EOL; $error = error_get_last(); if (isset($error)) { if (0 === strpos($error['message'], 'Allowed memory size')) { // ini_set('memory_limit', -1); w('AFTER ERROR'); } } }); w('FIRST'); function w($a) { echo $a; echo PHP_EOL; $r = 1000000; while($r--) { $m = str_repeat('a', 100000000); echo memory_get_usage() . ":" . rand(1,4) ; echo PHP_EOL; } } echo "WORK FINE";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TLFFe
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'register_shutdown_function'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTLFFe%3A6%240'
   19     2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4        INIT_FCALL_BY_NAME                                       'w'
          5        SEND_VAL_EX                                              'FIRST'
          6        DO_FCALL                                      0          
   40     7        ECHO                                                     'WORK+FINE'
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FTLFFe%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 17
filename:       /in/TLFFe
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'SHUTDOWN'
    9     1        ECHO                                                     '%0A'
   11     2        INIT_FCALL                                               'error_get_last'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   13     5        ISSET_ISEMPTY_CV                                         !0
          6      > JMPZ                                                     ~3, ->17
   14     7    >   INIT_FCALL                                               'strpos'
          8        FETCH_DIM_R                                      ~4      !0, 'message'
          9        SEND_VAL                                                 ~4
         10        SEND_VAL                                                 'Allowed+memory+size'
         11        DO_ICALL                                         $5      
         12        IS_IDENTICAL                                             $5, 0
         13      > JMPZ                                                     ~6, ->17
   16    14    >   INIT_FCALL_BY_NAME                                       'w'
         15        SEND_VAL_EX                                              'AFTER+ERROR'
         16        DO_FCALL                                      0          
   19    17    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FTLFFe%3A6%240

Function w:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 5
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 5
Branch analysis from position: 22
Branch analysis from position: 5
filename:       /in/TLFFe
function name:  w
number of ops:  23
compiled vars:  !0 = $a, !1 = $r, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        ECHO                                                     !0
   25     2        ECHO                                                     '%0A'
   26     3        ASSIGN                                                   !1, 1000000
   28     4      > JMP                                                      ->20
   30     5    >   INIT_FCALL                                               'str_repeat'
          6        SEND_VAL                                                 'a'
          7        SEND_VAL                                                 100000000
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !2, $4
   32    10        INIT_FCALL                                               'memory_get_usage'
         11        DO_ICALL                                         $6      
         12        CONCAT                                           ~7      $6, '%3A'
         13        INIT_FCALL                                               'rand'
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 4
         16        DO_ICALL                                         $8      
         17        CONCAT                                           ~9      ~7, $8
         18        ECHO                                                     ~9
   33    19        ECHO                                                     '%0A'
   28    20    >   POST_DEC                                         ~10     !1
         21      > JMPNZ                                                    ~10, ->5
   38    22    > > RETURN                                                   null

End of function w

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.22 ms | 1392 KiB | 25 Q