3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isMangled($key) { $arr = []; $arr[$key] = null; var_dump((string) $key, (string) key($arr)); return (string) $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/7csj8
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/7csj8
function name:  isMangled
number of ops:  21
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        INIT_FCALL                                               'var_dump'
          5        CAST                                          6  ~4      !0
          6        SEND_VAL                                                 ~4
          7        INIT_FCALL                                               'key'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        CAST                                          6  ~6      $5
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                                 
    7    13        CAST                                          6  ~8      !0
         14        INIT_FCALL                                               'key'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $9      
         17        CAST                                          6  ~10     $9
         18        IS_NOT_IDENTICAL                                 ~11     ~8, ~10
         19      > RETURN                                                   ~11
    8    20*     > RETURN                                                   null

End of function ismangled

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.22 ms | 1394 KiB | 22 Q