Re: object as function argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Björn Bartels wrote:
myab ths a stupid question, but i didn't find anything inside the php
docs:

is it possibe to pass an object (like $foo = new myObject(); ) to a
function as its argument (like my_func($foo); )

Yes, but if you're using PHP 4 you may want to define the function as taking that argument by reference (&$foo) unless you want to pass a copy of the object.

It would have taken you less time to write a test script and see for yourself than to search the docs and then post to the list...

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux