1) The patch introduce several new reserved words (resource, numeric,
scalar, object). This may break existing applications which use these
names as function or class names.
2) The patch should define something like ZEND_ARG_TYPE_INFO()
3) do we really need IS_CLASS constant?
4) arg_info->array_type_hint should be probably changed into
arg_info->type_hint. May be it's better to use bitset mask for it.
Then we won't need IS_SCALAR and IS_NUMERIC as well and
arg_info->allow_null field.
Otherwise the patch looks good, but note that for now it only slowdowns
execution a bit because of addition checks. I hope, it'll be possible to
use these hints in the future to generate more optimal code.
+1 for php6 after improvements
Thanks. Dmitry.
Ilia Alshanetsky wrote:
Last week or so there was a fairly detailed discussion on the internals
list regarding type hinting based on my original patch. Since then the
patch has been revised to address the major concerns that were
identified (breakage of binary compatibility) as well extended with
additional functionality (object hint, type casting, reflection support,
etc...).
The final patch is available here: http://ilia.ws/patch/type_hint_53_v2.txt
The test suit is available here: http://ia.gd/patch/type_hint_tests.tar.bz2
I would like to ask all developers to voice their opinions of whether it
makes sense to add this to 5.3 or to throw it away (either one is fine
btw). To keep the process simple & flamewar free, please restrict
yourself to +/- (1/0), next week monday I'll run a tally of the votes
and based on the result we can determine how to proceed further.
Ilia
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php