RE: How to type arguments

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

 



I'm surprised nobody mentioned:
http://php.net/assert
in this thread yet.

Perhaps I missed it?

You should really consider doing this:

1) At the outer API layer, do a typecast (possibly with preg_match first) to convert the input data to acceptable form.

2) For inner API layer[s], sprinkle "assert" calls as needed to make sure during dev/testing that the outer layer is doing it right.

In PROD, the assert can turn into a no-op, with no performance penalty, as I understand it.

Disclosure:
I've never worked on a project organized enough to actually do this properly.  Sigh.
:-)


-- 
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