Re: RFC: Type hinting revisited for PHP 5.3
| From: | Stanislav Malyshev | Date: | Fri, 03 Jul 2009 22:40:43 +0000 |
| Subject: | Re: RFC: Type hinting revisited for PHP 5.3 | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44689@lists.php.net to get a copy of this message | ||
Hi!
I wonder if the split is between people coming to PHP from web design (JavaScript/Perl) and coming to PHP from other programming languages (VB/Java/C++/COBOL/ColdFusion - a long list [1]). I've mainly comeI've learned Java in about '96 and Perl around the same time. I wonder which box you'd want to put me in :)
Maybe this could be solved easier and made more acceptable to all sides if rather than calling it "type hinting" / "(optional) strict typing" it was called "auto casting".But as proposed it's not casting, unlike (string) - which is casting - it would just reject the variable that is not string, without any attempt to convert type. It's strict typing, just like C or Java do.
So, rather than have the "explicit type conversions" being performed by users of the libraries, why not incorporate the conversions into the function/method declaration?That's what I was saying from the start. :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com