jimbob: object in array pushen?

hallo,

kann man eine instant einer klasse direct mit array push erzeugen?
Bsp:
array_push($this->element, new Input());

??
ist dies in dieser form möglich?

THX jimbob

  1. kann man eine instant einer klasse direct mit array push erzeugen?
    Bsp:
    array_push($this->element, new Input());

    hab nun eine temporäre variable eingeführt udn dann gehts!
    $temp_obj= new Input();
    array_push($this->element, $temp_obj);
    unset ($temp_obj);

    ??
    ist dies in dieser form möglich?

    also falls dass mal wer benötigt es ist möglich!

    1. ab php5 geht das direkt