- var_dump: documentation ( source)
<?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 ] );