Not necessarily, if you have a function that performs a generic
operation on any object. As for resources you are right, it might be

Like what? I don't know many operations that are good for any object and only object and need special function to perform them. Actually, excluding scenarios like serialization and RPC (which should take care of other types too so irrelevant here) I can't think of any right now.

ideal to have "mysql resource" rather than just "resource", but just
having the "resource" type hint is better than having no type hint.

No, it's not better. Having GD image instead of mysql connection is not better than having integer in any way. It would just produce different error message, so what?

This is one that I find very useful, much more than it may seem. I use
scalar for any type of post/get input, printed output, or DB
interaction, as objects/arrays/resources cannot be printed or stored in
a database in a standardized way.

If you need serialization/printing, you have serialize() and __toString() with respective handlers. If you reimplementing them and using scalar restrictions, you most probably do it wrong.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to