3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result1 = array_keys(['id' => 1]); // ['id'] $result2 = array_keys(['id' => 1], null); // [] $expected = ['id']; echo $expected === $result1 ? 1 : 0; // 1 true echo $expected === $result2 ? 1 : 0; // 0 false
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Branch analysis from position: 20
filename:       /in/69EUT
function name:  (null)
number of ops:  23
compiled vars:  !0 = $result1, !1 = $result2, !2 = $expected
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'array_keys'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    3     4        INIT_FCALL                                               'array_keys'
          5        SEND_VAL                                                 <array>
          6        SEND_VAL                                                 null
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    5     9        ASSIGN                                                   !2, <array>
    6    10        IS_IDENTICAL                                             !2, !0
         11      > JMPZ                                                     ~8, ->14
         12    >   QM_ASSIGN                                        ~9      1
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~9      0
         15    >   ECHO                                                     ~9
    7    16        IS_IDENTICAL                                             !2, !1
         17      > JMPZ                                                     ~10, ->20
         18    >   QM_ASSIGN                                        ~11     1
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~11     0
         21    >   ECHO                                                     ~11
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.5 ms | 1399 KiB | 15 Q