PHP VERSION: 7.0.26

uniform_variable_syntax_dereferencing_arrays_of_objects.php

<?php

$obj1 
= new stdClass();
$obj1->name 'Joe';
$obj2 = new stdClass();
$obj2->name 'Fred';

echo [
$obj1$obj2][0]->name;

Output


Joe
SOURCE CODE