3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array_fill(0, 10, fopen('php://temp', 'r+')); $t1 = microtime(true); foreach ($array as $key) { fclose($key); } echo microtime(true) - $t1 . PHP_EOL; $t2 = microtime(true); array_map('fclose', $array); echo microtime(true) - $t2 . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/KsVm3
function name:  (null)
number of ops:  42
compiled vars:  !0 = $array, !1 = $t1, !2 = $key, !3 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 10
          3        INIT_FCALL                                               'fopen'
          4        SEND_VAL                                                 'php%3A%2F%2Ftemp'
          5        SEND_VAL                                                 'r%2B'
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !0, $5
    5    10        INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
    6    14      > FE_RESET_R                                       $9      !0, ->20
         15    > > FE_FETCH_R                                               $9, !2, ->20
    7    16    >   INIT_FCALL                                               'fclose'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
    6    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $9
    9    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $11     
         24        SUB                                              ~12     $11, !1
         25        CONCAT                                           ~13     ~12, '%0A'
         26        ECHO                                                     ~13
   11    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $14     
         30        ASSIGN                                                   !3, $14
   12    31        INIT_FCALL                                               'array_map'
         32        SEND_VAL                                                 'fclose'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                                 
   13    35        INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $17     
         38        SUB                                              ~18     $17, !3
         39        CONCAT                                           ~19     ~18, '%0A'
         40        ECHO                                                     ~19
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.07 ms | 1400 KiB | 23 Q