3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numeric_fails = 0; $non_numeric_fails = 0; $iterations = 1000; $results = array(); for ($i = 0; $i < $iterations; $i++) { $my_key = uniqid("\x00"); $var = array(); $var[$my_key] = TRUE; foreach ($var as $key => $val) { if ($key === $my_key) { if (is_numeric($my_key)) { $results['Numeric Equal'] = TRUE; } else { $results['Non-numeric Equal'] = TRUE; } } else { if (is_numeric($my_key)) { $results['Numeric Fail'] = TRUE; } else { $results['Non-numeric Fail'] = TRUE; } } } } var_dump($results);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 6
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 38
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 38
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 6
Branch analysis from position: 42
Branch analysis from position: 6
Branch analysis from position: 38
filename:       /in/jtX6P
function name:  (null)
number of ops:  46
compiled vars:  !0 = $numeric_fails, !1 = $non_numeric_fails, !2 = $iterations, !3 = $results, !4 = $i, !5 = $my_key, !6 = $var, !7 = $val, !8 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
          1        ASSIGN                                                   !1, 0
          2        ASSIGN                                                   !2, 1000
    3     3        ASSIGN                                                   !3, <array>
    5     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->40
    6     6    >   INIT_FCALL                                               'uniqid'
          7        SEND_VAL                                                 '%00'
          8        DO_ICALL                                         $14     
          9        ASSIGN                                                   !5, $14
    8    10        ASSIGN                                                   !6, <array>
    9    11        ASSIGN_DIM                                               !6, !5
         12        OP_DATA                                                  <true>
   11    13      > FE_RESET_R                                       $18     !6, ->38
         14    > > FE_FETCH_R                                       ~19     $18, !7, ->38
         15    >   ASSIGN                                                   !8, ~19
   12    16        IS_IDENTICAL                                             !8, !5
         17      > JMPZ                                                     ~21, ->28
   13    18    >   INIT_FCALL                                               'is_numeric'
         19        SEND_VAR                                                 !5
         20        DO_ICALL                                         $22     
         21      > JMPZ                                                     $22, ->25
   14    22    >   ASSIGN_DIM                                               !3, 'Numeric+Equal'
         23        OP_DATA                                                  <true>
         24      > JMP                                                      ->27
   16    25    >   ASSIGN_DIM                                               !3, 'Non-numeric+Equal'
         26        OP_DATA                                                  <true>
         27    > > JMP                                                      ->37
   19    28    >   INIT_FCALL                                               'is_numeric'
         29        SEND_VAR                                                 !5
         30        DO_ICALL                                         $25     
         31      > JMPZ                                                     $25, ->35
   20    32    >   ASSIGN_DIM                                               !3, 'Numeric+Fail'
         33        OP_DATA                                                  <true>
         34      > JMP                                                      ->37
   22    35    >   ASSIGN_DIM                                               !3, 'Non-numeric+Fail'
         36        OP_DATA                                                  <true>
   11    37    > > JMP                                                      ->14
         38    >   FE_FREE                                                  $18
    5    39        PRE_INC                                                  !4
         40    >   IS_SMALLER                                               !4, !2
         41      > JMPNZ                                                    ~29, ->6
   27    42    >   INIT_FCALL                                               'var_dump'
         43        SEND_VAR                                                 !3
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.65 ms | 1400 KiB | 19 Q