PHP VERSION: 8.2.18

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