3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); $fila = range(1, 20000); // prueba con 10_000, 20_000 y 40_000 $atendidos = 0; $t0 = hrtime(true); /* while ($fila) { $cliente = array_shift($fila); $atendidos++; } */ /* foreach ($fila as $cliente) { $atendidos++; } */ while ($atendidos < count($fila)) { $cliente = $fila[$atendidos]; $atendidos++; } $t1 = hrtime(true); echo "Atendidos: {$atendidos}", PHP_EOL; echo "DemorĂ³: ", ($t1 - $t0) / 1e6, " ms";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/nDQpJ
function name:  (null)
number of ops:  31
compiled vars:  !0 = $fila, !1 = $atendidos, !2 = $t0, !3 = $cliente, !4 = $t1
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                                   'range'
          1        SEND_VAL                                                     1
          2        SEND_VAL                                                     20000
          3        DO_ICALL                                             $5      
          4        ASSIGN                                                       !0, $5
    6     5        ASSIGN                                                       !1, 0
    7     6        INIT_FCALL                                                   'hrtime'
          7        SEND_VAL                                                     <true>
          8        DO_ICALL                                             $8      
          9        ASSIGN                                                       !2, $8
   21    10      > JMP                                                          ->14
   22    11    >   FETCH_DIM_R                                          ~10     !0, !1
         12        ASSIGN                                                       !3, ~10
   23    13        PRE_INC                                                      !1
   21    14    >   COUNT                                                ~13     !0
         15        IS_SMALLER                                                   !1, ~13
         16      > JMPNZ                                                        ~14, ->11
   26    17    >   INIT_FCALL                                                   'hrtime'
         18        SEND_VAL                                                     <true>
         19        DO_ICALL                                             $15     
         20        ASSIGN                                                       !4, $15
   28    21        NOP                                                          
         22        FAST_CONCAT                                          ~17     'Atendidos%3A+', !1
         23        ECHO                                                         ~17
         24        ECHO                                                         '%0A'
   29    25        ECHO                                                         'Demor%C3%B3%3A+'
         26        SUB                                                  ~18     !4, !2
         27        DIV                                                  ~19     ~18, 1.0e+6
         28        ECHO                                                         ~19
         29        ECHO                                                         '+ms'
         30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.66 ms | 481 KiB | 9 Q