3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); $b = []; // original result var_dump(!trim(((string)($b['b'] ?? '')))); // applied change to replace above leading to different result var_dump(trim(((string)($b['b'] ?? ''))) !== ''); // replacement with same result would be this, // but it's not clear if the original check has // been ment to be that kind of check and was // obsured away. var_dump(trim(((string)($b['b'] ?? ''))) === '');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1jsh
function name:  (null)
number of ops:  32
compiled vars:  !0 = $b
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_IS                                         ~3      !0, 'b'
          6        COALESCE                                             ~4      ~3
          7        QM_ASSIGN                                            ~4      ''
          8        CAST                                              6  ~5      ~4
          9        FRAMELESS_ICALL_1                trim                ~6      ~5
         10        BOOL_NOT                                             ~7      ~6
         11        SEND_VAL                                                     ~7
         12        DO_ICALL                                                     
   11    13        INIT_FCALL                                                   'var_dump'
         14        FETCH_DIM_IS                                         ~9      !0, 'b'
         15        COALESCE                                             ~10     ~9
         16        QM_ASSIGN                                            ~10     ''
         17        CAST                                              6  ~11     ~10
         18        FRAMELESS_ICALL_1                trim                ~12     ~11
         19        IS_NOT_IDENTICAL                                     ~13     ~12, ''
         20        SEND_VAL                                                     ~13
         21        DO_ICALL                                                     
   17    22        INIT_FCALL                                                   'var_dump'
         23        FETCH_DIM_IS                                         ~15     !0, 'b'
         24        COALESCE                                             ~16     ~15
         25        QM_ASSIGN                                            ~16     ''
         26        CAST                                              6  ~17     ~16
         27        FRAMELESS_ICALL_1                trim                ~18     ~17
         28        IS_IDENTICAL                                         ~19     ~18, ''
         29        SEND_VAL                                                     ~19
         30        DO_ICALL                                                     
         31      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
139.49 ms | 488 KiB | 11 Q