3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isMangled($key) { $arr = array(); $arr[$key] = null; return (string) $key !== (string) key($arr); } var_dump( isMangled(1), isMangled(1.5), isMangled('1'), isMangled('1.5'), isMangled(null), isMangled("test"), isMangled("test\0") );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qUR9G
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
   10     1        INIT_FCALL                                               'ismangled'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
   11     5        INIT_FCALL                                               'ismangled'
          6        SEND_VAL                                                 1.5
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR                                                 $1
   12     9        INIT_FCALL                                               'ismangled'
         10        SEND_VAL                                                 '1'
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
   13    13        INIT_FCALL                                               'ismangled'
         14        SEND_VAL                                                 '1.5'
         15        DO_FCALL                                      0  $3      
         16        SEND_VAR                                                 $3
   14    17        INIT_FCALL                                               'ismangled'
         18        SEND_VAL                                                 null
         19        DO_FCALL                                      0  $4      
         20        SEND_VAR                                                 $4
   15    21        INIT_FCALL                                               'ismangled'
         22        SEND_VAL                                                 'test'
         23        DO_FCALL                                      0  $5      
         24        SEND_VAR                                                 $5
   16    25        INIT_FCALL                                               'ismangled'
         26        SEND_VAL                                                 'test%00'
         27        DO_FCALL                                      0  $6      
         28        SEND_VAR                                                 $6
         29        DO_ICALL                                                 
   17    30      > RETURN                                                   1

Function ismangled:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qUR9G
function name:  isMangled
number of ops:  12
compiled vars:  !0 = $key, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN_DIM                                               !1, !0
          3        OP_DATA                                                  null
    6     4        CAST                                          6  ~4      !0
          5        INIT_FCALL                                               'key'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        CAST                                          6  ~6      $5
          9        IS_NOT_IDENTICAL                                 ~7      ~4, ~6
         10      > RETURN                                                   ~7
    7    11*     > RETURN                                                   null

End of function ismangled

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.21 ms | 1394 KiB | 24 Q