Re: RE: Optional scalar type hinting
| From: | Alain Williams | Date: | Fri, 04 Jan 2008 00:58:23 +0000 |
| Subject: | Re: RE: Optional scalar type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34384@lists.php.net to get a copy of this message | ||
On Thu, Jan 03, 2008 at 03:14:37PM -0500, Sam Barrow wrote:
> On Thu, 2008-01-03 at 13:00 -0700, John Coggeshall wrote:
>
> > Wouldn't this patch also allow for additional performace optimizations
> > which would help counter losses even in the non-general case?
>
> Performance optimizations in what way?
I gave an example in another post.
Summary: the argument value is check to be (say) numeric on function entry,
if it is not numeric but can be converted to a number (eg it is a string of digits)
then the convertion is done on function entry.
If the value is used several times within the code (presumably as a number)
then the type juggle 'string of digits -> number' will not need to be done
since it was done on function entry.
--
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>