3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = []; foreach (range(1,5000) as $i) { $foo[] = ['username' => md5(time()), 'limits' => ['ep' => rand(1,20)]]; } $time_start = microtime(true); foreach ($foo as $row) { if ($row['limits']['ep'] == 3) { $a = 1 + 2; } array_search("needle", array_column($foo, "username")); } $time_end = microtime(true); $time = $time_end - $time_start; echo "Did nothing in $time seconds\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 22
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 43
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 43
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 34
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 34
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 22
filename:       /in/6lS9i
function name:  (null)
number of ops:  55
compiled vars:  !0 = $foo, !1 = $i, !2 = $time_start, !3 = $row, !4 = $a, !5 = $time_end, !6 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 5000
          4        DO_ICALL                                         $8      
          5      > FE_RESET_R                                       $9      $8, ->22
          6    > > FE_FETCH_R                                               $9, !1, ->22
    5     7    >   INIT_FCALL                                               'md5'
          8        INIT_FCALL                                               'time'
          9        DO_ICALL                                         $11     
         10        SEND_VAR                                                 $11
         11        DO_ICALL                                         $12     
         12        INIT_ARRAY                                       ~13     $12, 'username'
         13        INIT_FCALL                                               'rand'
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 20
         16        DO_ICALL                                         $14     
         17        INIT_ARRAY                                       ~15     $14, 'ep'
         18        ADD_ARRAY_ELEMENT                                ~13     ~15, 'limits'
         19        ASSIGN_DIM                                               !0
         20        OP_DATA                                                  ~13
    4    21      > JMP                                                      ->6
         22    >   FE_FREE                                                  $9
    9    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !2, $16
   11    27      > FE_RESET_R                                       $18     !0, ->43
         28    > > FE_FETCH_R                                               $18, !3, ->43
   12    29    >   FETCH_DIM_R                                      ~19     !3, 'limits'
         30        FETCH_DIM_R                                      ~20     ~19, 'ep'
         31        IS_EQUAL                                                 ~20, 3
         32      > JMPZ                                                     ~21, ->34
         33    >   ASSIGN                                                   !4, 3
   13    34    >   INIT_FCALL                                               'array_search'
         35        SEND_VAL                                                 'needle'
         36        INIT_FCALL                                               'array_column'
         37        SEND_VAR                                                 !0
         38        SEND_VAL                                                 'username'
         39        DO_ICALL                                         $23     
         40        SEND_VAR                                                 $23
         41        DO_ICALL                                                 
   11    42      > JMP                                                      ->28
         43    >   FE_FREE                                                  $18
   17    44        INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $25     
         47        ASSIGN                                                   !5, $25
   18    48        SUB                                              ~27     !5, !2
         49        ASSIGN                                                   !6, ~27
   20    50        ROPE_INIT                                     3  ~30     'Did+nothing+in+'
         51        ROPE_ADD                                      1  ~30     ~30, !6
         52        ROPE_END                                      2  ~29     ~30, '+seconds%0A'
         53        ECHO                                                     ~29
         54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.35 ms | 1400 KiB | 27 Q