Re: Type hinting

From: Date: Sun, 23 May 2010 08:37:23 +0000
Subject: Re: Type hinting
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-48406@lists.php.net to get a copy of this message
Hi!
I agree. function foo(array $x) {} foo(123); doesn't cast int(123) to array(123) so introducing different meaning for scalar types feels very very wrong.
Casting integers to arrays never happened in PHP. Casting strings to integers and back always happened. Including in internal functions. Now internal and user functions would work differently, and half of PHP would be dynamically typed while another half would be statically typed. I fail to see how it may be a good thing. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#48406) next »