3v4l.org

run code in 300+ PHP versions simultaneously
<?php //ini_set('memory_limit','40M'); $m0 = memory_get_usage(); for ($i=0;$i<5000;++$i){ $context = stream_context_create(array('socket'=>array('backlog'=>511))); $server = @stream_socket_server( 'tcp://127.1.1.1:0', $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context ); if ($server !== false) { fclose($server); } unset($server); unset($context); unset($errno); unset($errstr); } $m1 = memory_get_usage(); echo ($m1-$m0)/1048576,' MB allocated',PHP_EOL; $cycles = gc_collect_cycles() + gc_collect_cycles(); echo 'Ran ', $cycles, ' GC Cycles', PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 5
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 5
Branch analysis from position: 31
Branch analysis from position: 5
Branch analysis from position: 24
filename:       /in/XBaaP
function name:  (null)
number of ops:  50
compiled vars:  !0 = $m0, !1 = $i, !2 = $context, !3 = $server, !4 = $errno, !5 = $errstr, !6 = $m1, !7 = $cycles
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $8      
          2        ASSIGN                                                   !0, $8
    6     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->29
    7     5    >   INIT_FCALL                                               'stream_context_create'
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $11     
          8        ASSIGN                                                   !2, $11
    8     9        BEGIN_SILENCE                                    ~13     
         10        INIT_FCALL                                               'stream_socket_server'
    9    11        SEND_VAL                                                 'tcp%3A%2F%2F127.1.1.1%3A0'
   10    12        SEND_REF                                                 !4
   11    13        SEND_REF                                                 !5
   12    14        SEND_VAL                                                 12
   13    15        SEND_VAR                                                 !2
    8    16        DO_ICALL                                         $14     
   13    17        END_SILENCE                                              ~13
    8    18        ASSIGN                                                   !3, $14
   15    19        TYPE_CHECK                                  1018          !3
         20      > JMPZ                                                     ~16, ->24
   16    21    >   INIT_FCALL                                               'fclose'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
   18    24    >   UNSET_CV                                                 !3
   19    25        UNSET_CV                                                 !2
   20    26        UNSET_CV                                                 !4
   21    27        UNSET_CV                                                 !5
    6    28        PRE_INC                                                  !1
         29    >   IS_SMALLER                                               !1, 5000
         30      > JMPNZ                                                    ~19, ->5
   23    31    >   INIT_FCALL                                               'memory_get_usage'
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !6, $20
   24    34        SUB                                              ~22     !6, !0
         35        DIV                                              ~23     ~22, 1048576
         36        ECHO                                                     ~23
         37        ECHO                                                     '+MB+allocated'
         38        ECHO                                                     '%0A'
   26    39        INIT_FCALL                                               'gc_collect_cycles'
         40        DO_ICALL                                         $24     
         41        INIT_FCALL                                               'gc_collect_cycles'
         42        DO_ICALL                                         $25     
         43        ADD                                              ~26     $24, $25
         44        ASSIGN                                                   !7, ~26
   27    45        ECHO                                                     'Ran+'
         46        ECHO                                                     !7
         47        ECHO                                                     '+GC+Cycles'
         48        ECHO                                                     '%0A'
   28    49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.1 ms | 1020 KiB | 18 Q