Hi!

   Which is why, for instance, PHPUnit today is full of code like this

     public function foo($flag)
     {
         if (!is_bool($flag)) {
             throw new InvalidArgumentException(/* ... */);
         }
     }

   This is the type of code that I want to get rid off using scalar type
   hints.

The question here is does it make sense somewhere outside PHPUnit? I.e. I can see why unit test cares if method returned "false" or "" or 0 - because if you test for value false, you should get false. However, outside the test realm, why would you case if you need to disable an option and get 0 instead of false? Was it unclear what 0 meant? Is there any problem with interpreting what user intended to do and doing it? Why insist on having right zval bits?
--
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