<?php class A { public $elementos = []; public function __construct() { for ($i = 0; $i < 10; $i++) { $this->elementos[] = $i; } } } class B { public $elementos = []; public function __construct($num=10) { for ($i = 0; $i < $num; $i++) { $this->elementos[] = $i; } } } $a = new A(); $b = new A(); $c = new B(3); $d = new B(9); $e = new B(); print_r($c->elementos); print_r($d->elementos); print_r($e->elementos); ?>