3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); $a = ['key' => false,]; // original with key access arror and correct array but false value var_dump(!$a['key']); var_dump(!$a['key2']); echo PHP_EOL; // changed behavior for false value, array access warning fixed - change in behaviour !!! var_dump(!isset($a['key2'])); var_dump(!isset($a['key2'])); echo PHP_EOL; // this should be used instead, solving array key access error and not changing behaviour var_dump(!($a['key'] ?? false)); var_dump(!($a['key2'] ?? false));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eqqJV
function name:  (null)
number of ops:  41
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     30719
          2        DO_ICALL                                                     
    5     3        ASSIGN                                                       !0, <array>
    8     4        INIT_FCALL                                                   'var_dump'
          5        FETCH_DIM_R                                          ~3      !0, 'key'
          6        BOOL_NOT                                             ~4      ~3
          7        SEND_VAL                                                     ~4
          8        DO_ICALL                                                     
    9     9        INIT_FCALL                                                   'var_dump'
         10        FETCH_DIM_R                                          ~6      !0, 'key2'
         11        BOOL_NOT                                             ~7      ~6
         12        SEND_VAL                                                     ~7
         13        DO_ICALL                                                     
   12    14        ECHO                                                         '%0A'
   15    15        INIT_FCALL                                                   'var_dump'
         16        ISSET_ISEMPTY_DIM_OBJ                             0  ~9      !0, 'key2'
         17        BOOL_NOT                                             ~10     ~9
         18        SEND_VAL                                                     ~10
         19        DO_ICALL                                                     
   16    20        INIT_FCALL                                                   'var_dump'
         21        ISSET_ISEMPTY_DIM_OBJ                             0  ~12     !0, 'key2'
         22        BOOL_NOT                                             ~13     ~12
         23        SEND_VAL                                                     ~13
         24        DO_ICALL                                                     
   19    25        ECHO                                                         '%0A'
   22    26        INIT_FCALL                                                   'var_dump'
         27        FETCH_DIM_IS                                         ~15     !0, 'key'
         28        COALESCE                                             ~16     ~15
         29        QM_ASSIGN                                            ~16     <false>
         30        BOOL_NOT                                             ~17     ~16
         31        SEND_VAL                                                     ~17
         32        DO_ICALL                                                     
   23    33        INIT_FCALL                                                   'var_dump'
         34        FETCH_DIM_IS                                         ~19     !0, 'key2'
         35        COALESCE                                             ~20     ~19
         36        QM_ASSIGN                                            ~20     <false>
         37        BOOL_NOT                                             ~21     ~20
         38        SEND_VAL                                                     ~21
         39        DO_ICALL                                                     
         40      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.79 ms | 491 KiB | 11 Q