3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isMangled($key) { $key = (string)$key; $arr = []; $arr[$key] = null; return $key !== (string)key($arr); } var_dump( 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/LCU0d
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
   11     1        INIT_FCALL                                               'ismangled'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
   12     5        INIT_FCALL                                               'ismangled'
          6        SEND_VAL                                                 1.5
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR                                                 $1
   13     9        INIT_FCALL                                               'ismangled'
         10        SEND_VAL                                                 null
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
   14    13        INIT_FCALL                                               'ismangled'
         14        SEND_VAL                                                 'test'
         15        DO_FCALL                                      0  $3      
         16        SEND_VAR                                                 $3
   15    17        INIT_FCALL                                               'ismangled'
         18        SEND_VAL                                                 'test%00'
         19        DO_FCALL                                      0  $4      
         20        SEND_VAR                                                 $4
         21        DO_ICALL                                                 
   16    22      > RETURN                                                   1

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

End of function ismangled

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.57 ms | 1398 KiB | 22 Q