3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Scenario 1 $preferred_icon = 'test'; $plugin_data = null; var_dump( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ); // Scenario 2 $plugin_data = new stdClass(); $plugin_data->update = new stdClass(); $plugin_data->update->icons = null; var_dump( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ); // Now try it without the `empty()`. // Scenario 3 var_dump( $plugin_data->update->icons[ $preferred_icon ] ); // Scenario 5 $plugin_data = new stdClass(); $plugin_data->update = new stdClass(); var_dump( $plugin_data->update->icons[ $preferred_icon ] );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAVJ9
function name:  (null)
number of ops:  46
compiled vars:  !0 = $preferred_icon, !1 = $plugin_data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, 'test'
    5     1        ASSIGN                                                       !1, null
    6     2        INIT_FCALL                                                   'var_dump'
          3        FETCH_OBJ_IS                                         ~4      !1, 'update'
          4        FETCH_OBJ_IS                                         ~5      ~4, 'icons'
          5        ISSET_ISEMPTY_DIM_OBJ                             1  ~6      ~5, !0
          6        BOOL_NOT                                             ~7      ~6
          7        SEND_VAL                                                     ~7
          8        DO_ICALL                                                     
    9     9        NEW                                                  $9      'stdClass'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !1, $9
   10    12        NEW                                                  $13     'stdClass'
         13        DO_FCALL                                          0          
         14        ASSIGN_OBJ                                                   !1, 'update'
         15        OP_DATA                                                      $13
   11    16        FETCH_OBJ_W                                          $15     !1, 'update'
         17        ASSIGN_OBJ                                                   $15, 'icons'
         18        OP_DATA                                                      null
   12    19        INIT_FCALL                                                   'var_dump'
         20        FETCH_OBJ_IS                                         ~17     !1, 'update'
         21        FETCH_OBJ_IS                                         ~18     ~17, 'icons'
         22        ISSET_ISEMPTY_DIM_OBJ                             1  ~19     ~18, !0
         23        BOOL_NOT                                             ~20     ~19
         24        SEND_VAL                                                     ~20
         25        DO_ICALL                                                     
   17    26        INIT_FCALL                                                   'var_dump'
         27        FETCH_OBJ_R                                          ~22     !1, 'update'
         28        FETCH_OBJ_R                                          ~23     ~22, 'icons'
         29        FETCH_DIM_R                                          ~24     ~23, !0
         30        SEND_VAL                                                     ~24
         31        DO_ICALL                                                     
   20    32        NEW                                                  $26     'stdClass'
         33        DO_FCALL                                          0          
         34        ASSIGN                                                       !1, $26
   21    35        NEW                                                  $30     'stdClass'
         36        DO_FCALL                                          0          
         37        ASSIGN_OBJ                                                   !1, 'update'
         38        OP_DATA                                                      $30
   22    39        INIT_FCALL                                                   'var_dump'
         40        FETCH_OBJ_R                                          ~32     !1, 'update'
         41        FETCH_OBJ_R                                          ~33     ~32, 'icons'
         42        FETCH_DIM_R                                          ~34     ~33, !0
         43        SEND_VAL                                                     ~34
         44        DO_ICALL                                                     
         45      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.79 ms | 1756 KiB | 14 Q