Re: svn: /php/php-src/trunk/ NEWS Zend/tests/array_type_hint_001.phpt Zend/tests/hint/param_type_hint_001.phpt
Zend/tests/hint/param_type_hint_002.phpt Zend/tests/hint/param_type_hint_003.phpt Zend/tests/hint/param_type_hint_004.phpt Zend/t
| From: | Felipe Pena | Date: | Sat, 22 May 2010 18:36:16 +0000 |
| Subject: | Re: svn: /php/php-src/trunk/ NEWS Zend/tests/array_type_hint_001.phpt Zend/tests/hint/param_type_hint_001.phpt Zend/tests/hint/param_type_hint_002.phpt Zend/tests/hint/param_type_hint_003.phpt Zend/tests/hint/param_type_hint_004.phpt Zend/t |
||
| References: | 1 2 3 4 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-62689@lists.php.net to get a copy of this message | ||
Ilia,
2010/5/22 Ilia Alshanetsky <ilia@prohost.org>
> Felipe,
>
> The idea behind the more complex logic was to allow people to have
> Int/String/etc... class names, which if we make the types reserved keywords
> will no longer be possible and break existing code.
>
>
I didn't knew that plan. Anyway, it can be done by matching the type name in
the case-sensitive way.
-<ST_IN_SCRIPTING>("string"|"binary"){TABS_AND_SPACES}[
\t&]+"$" {
- yyless(6);
+<ST_IN_SCRIPTING>('string'|'binary') {
<?php
class String { }
function f(string $a){}
f('foo');
f(new String); // Catchable fatal error: Argument 1 passed to f() must be of
the type string, object given ...
--
Regards,
Felipe Pena