name = $name; } } // Creating the array of objects $persons = [ new Person("Peter"), new Person("Alice"), new Person("Clark"), ]; // Getting the column of names $names = array_column($persons, "name"); print_r($names); ?>