Re: RFC: Type hinting revisited for PHP 5.3
| From: | Ilia Alshanetsky | Date: | Sat, 04 Jul 2009 19:00:02 +0000 |
| Subject: | Re: RFC: Type hinting revisited for PHP 5.3 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44707@lists.php.net to get a copy of this message | ||
It should be fine
Ilia Alshanetsky
On 2009-07-04, at 2:49 PM, Paul Biggar <paul.biggar@gmail.com> wrote:
Hi Ilia, On Wed, Jul 1, 2009 at 5:59 PM, Ilia Alshanetsky<ilia@prohost.org> wrote:There has been quite a bit of discussion on this list, IRC, developer meetings, etc... about introduction of type hinting to PHP. Most peopleRE your second patch, from http://ilia.ws/patch/type_hint_53_v2.txt Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.647.2.27.2.41.2.109 diff -u -p -a -d -u -r1.647.2.27.2.41.2.109 zend_compile.c--- Zend/zend_compile.c 7 Jun 2009 15:46:51 -0000 1.647.2.27.2.41.2.109 +++ Zend/zend_compile.c 4 Jul 2009 17:20:50 -0000@@ -1511,10 +1514,9 @@ void zend_do_receive_arg(zend_uchar op,zend_error(E_COMPILE_ERROR, "Default value for parameters with aclass type hint can only be NULL");} } - } else { - cur_arg_info->array_type_hint = 1; - cur_arg_info->class_name = NULL; - cur_arg_info->class_name_len = 0; + break;++ case IS_ARRAY:So, to signify an array type hint, we used to use 1, and we now use IS_ARRAY, which is 4. I'm not 100% sure that's an ABI problem, but I just wanted to check.if (op == ZEND_RECV_INIT) { if (Z_TYPE(initialization->u.constant) == IS_NULL ||(Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {cur_arg_info->allow_null = 1;