Just in case anyone lost track... it seems the consensus is to allow the
optional parameter syntax for class hints. The Nullable class hint doesn't
seem to be well supported among the purists so the optional param syntax,
while not optimal, is better than leaving it as it is now. One can always
rearrange their parameters to support this method.

Not gonna bother with a patch file, something to the effect of...

Line 1219 of zend_compile.c

+ if (op == ZEND_RECV_INIT) {
+ cur_arg_info->allow_null = 1;
+ } else {
cur_arg_info->allow_null = 0;
+ }

No need to check/force NULL as the initializer, the runtime
zend_verify_arg_type handles that check. BC isn't an issue since this syntax
was a runtime error in 5.0. It would be nice to see this in 5.1.

Bob Silva

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
postedOct 30, '04 at 6:49a
activeOct 30, '04 at 6:49a

1 user in discussion

Robert Silva: 1 post



site design / logo © 2023 Grokbase