http://www.php.net/manual/en/language.references.php http://www.php.net/manual/en/language.oop.php
Examples 1 and 4 are equivalent Example 2 assigns a reference of the new object to $form Example 3 assigns the value from the DB class method connect() to $dbh (could be an object or some other value) Example 5 is the same as 3 except that it assigns a reference of the value returned from the Mail class method factory() to $mail_object. Justin Garrett "Beau Hartshorne" <[EMAIL PROTECTED]> wrote in message 000001c2ce00$d19797d0$6401a8c0@laptop">news:000001c2ce00$d19797d0$6401a8c0@laptop... > I'm just starting to use PEAR, and have seen several ways of > instantiating the PEAR objects: > > $form = new HTML_QuickForm(); > $form =& new HTML_QuickForm(); > $dbh = DB:connect("dsn"); > $dbh = new DB(); > $mail_object =& Mail::factory('sendmail', $params); > > Can anyone explain (or point to dome docs that explain) what the > differences are, and when I should be using which method to work with > PEAR objects? > > Thank you, > > Beau > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php