Re: U

From: Date: Sat, 05 Jan 2008 23:11:44 +0000
Subject: Re: U
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-34513@lists.php.net to get a copy of this message
Also, function foo(SomeClass $obj) would error out if passed something other than a SomeClass instance, while function foo(int $number) would just cast $number to int. Not really intuitive and not really consistent. Regards, Vlad Bosinceanu Stefan Esser wrote:
Hello,
typing into PHP, even if it is optional. Passing $_REQUEST['age'] to a
          
that $_REQUEST['age'] has been checked for numeric before the functio
would you please not use $_REQUEST in any of your examples? $_REQUEST is one of the biggest design weaknesses in PHP. Every application using $_REQUEST is most probably vulnerable to Delayed Cross Site Request Forgery problems. (This basically means if e.g. a cookie named (age) exists it will always overwrite the GET/POST content and therefore unwanted requests will be performed) And well... This thread continues without a single valid (!= personal opinion) reason why type hinting should NOT be introduced. BTW accepting the string '1' where an (int) type hint is placed would be the next stupid design decision. Yours, Stefan Esser


« previous php.internals (#34513) next »