3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numeric = ['foo', 'bar', 'qux']; $assoc = ['foo' => 'something', 'bar' => 'else', 'qux' => 'ya']; $fakeNumeric = ['foo', '1' => 'bar', 'qux']; function isNumericKey(array $array) { return is_numeric(implode(array_keys($array))); } var_dump(isNumericKey($numeric)); var_dump(isNumericKey($assoc)); var_dump(isNumericKey($fakeNumeric));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eP5pj
function name:  (null)
number of ops:  22
compiled vars:  !0 = $numeric, !1 = $assoc, !2 = $fakeNumeric
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
   11     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'isnumerickey'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $6      
          7        SEND_VAR                                                 $6
          8        DO_ICALL                                                 
   12     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'isnumerickey'
         11        SEND_VAR                                                 !1
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
   13    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'isnumerickey'
         17        SEND_VAR                                                 !2
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function isnumerickey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eP5pj
function name:  isNumericKey
number of ops:  12
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'is_numeric'
          2        INIT_FCALL                                               'implode'
          3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
    9    11*     > RETURN                                                   null

End of function isnumerickey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.84 ms | 1399 KiB | 24 Q