Hi!

   I have seen boilerplate [1] code like this in other Open Source projects
   as well as closed-source applications.

I've seen all kinds of code, whether making sense or not. The question is not if somebody somewhere is doing it but if it's the right thing to recommend to do. I think that outside very limited areas (like unit tests, etc.) where actual zval types matter, it usually is not. I don't see how distinguishing 0 from false may make sense in this case, unless the method is something like assertFalse(). And in the latter case you probably want to handle it inside anyway since you've got to compose the nice error message :)

On top of that, your boilerplate throws exception. Strict typing would error out. That's very different thing (exceptions can be handled hierarchically, errors can't). So replacing that with strict type probably won't do the same.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to