3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_key = uniqid("\x00"); if (preg_match('/[a-zA-Z]/', $my_key)) { echo "key has alpha chars\n"; } $my_key = preg_replace('/[a-zA-Z]/', "4", $my_key); var_dump(is_numeric($my_key)); $var[$my_key] = TRUE; foreach($var as $key => $val) { if ($key === $my_key) { echo 'You got it right'; } else { echo 'You got it wrong'; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 10
filename:       /in/4elBE
function name:  (null)
number of ops:  35
compiled vars:  !0 = $my_key, !1 = $var, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'uniqid'
          1        SEND_VAL                                                 '%00'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    3     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%5Ba-zA-Z%5D%2F'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->10
    4     9    >   ECHO                                                     'key+has+alpha+chars%0A'
    6    10    >   INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%5Ba-zA-Z%5D%2F'
         12        SEND_VAL                                                 '4'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !0, $7
    7    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'is_numeric'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
    9    22        ASSIGN_DIM                                               !1, !0
         23        OP_DATA                                                  <true>
   10    24      > FE_RESET_R                                       $12     !1, ->33
         25    > > FE_FETCH_R                                       ~13     $12, !2, ->33
         26    >   ASSIGN                                                   !3, ~13
   12    27        IS_IDENTICAL                                             !3, !0
         28      > JMPZ                                                     ~15, ->31
   13    29    >   ECHO                                                     'You+got+it+right'
         30      > JMP                                                      ->32
   15    31    >   ECHO                                                     'You+got+it+wrong'
   10    32    > > JMP                                                      ->25
         33    >   FE_FREE                                                  $12
   17    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.96 ms | 1400 KiB | 23 Q