nie znalazłem nic o tym więc założyłem nowy temat.
Jak przy pomocy return mogę otrzymać np: całą tablice

<?php class Animals extends Person{ var $color,$type; function __construct($name,$age,$color,$type){ $this -> name = $name; $this -> age = $age; $this -> color = $color; $this -> type = $type; 'name' => $this -> name, 'age' => $this -> age, 'color' => $this -> color, 'type' => $this -> type); } function print_all_animals(){ return <----------------- i tu KLIN } } ?>
wiem że można to zrobić w taki sposób :
<?php function print_all_animals(){ foreach($_SESSION['table_animals'] as $key => $value){ } ?>
ale nie chcę rozwiązać tego w powyższy sposób. Da się wydrukować elementy tej tablicy poprzez return
