Re: [RFC] Replace "Missing argument" warning with "Too few arguments" exception
| From: | Dmitry Stogov | Date: | Wed, 01 Jun 2016 18:24:16 +0000 |
| Subject: | Re: [RFC] Replace "Missing argument" warning with "Too few arguments" exception | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93687@lists.php.net to get a copy of this message | ||
In the SSA optimisation framework (part of opcache), we predict and propagate types of variables.
We also may detect situations when some variables may be undefined.
If variable can't be "undefined", we may avoid unnecessary run-time checks (e.g .like
in ZEND_ADD_LONG handler).
Local variables almost always initialized before usage, but with exiting behavior, function
arguments always may be uninitialized.
$ sapi/cli/php -d opcache.opt_debug_level=0x400000 2>&1 ../Zend/bench.php | less
...
fibo_r: ; (lines=14, args=1, vars=1, tmps=3, ssa_vars=9, no_loops)
...
#1.CV0($n) [undef, any] = RECV 1
#2.T1 [bool] RANGE[0..1] = IS_SMALLER #1.CV0($n) [undef, any] int(2)
JMPZ #2.T1 [bool] RANGE[0..1] BB2
...
With the patch $n won't include "undef" anymore.
Thanks. Dmitry.
________________________________
From: Joe Watkins <pthreads@pthreads.org>
Sent: Wednesday, June 1, 2016 8:42:49 PM
To: Dmitry Stogov
Cc: PHP internals; Nikita Popov
Subject: Re: [PHP-DEV] [RFC] Replace "Missing argument" warning with "Too few
arguments" exception
Evening,
Could you expand on the "obvious optimization opportunities" in the document ?
They are not obvious to me, and even if they were, this document is part of the history of this
change, so a little more detail would be nice.
Cheers
Joe
On Wed, Jun 1, 2016 at 11:55 AM, Dmitry Stogov <dmitry@zend.com<mailto:dmitry@zend.com>> wrote:
hi,
Please take a look into the proposal.
https://wiki.php.net/rfc/too_few_args
The RFC is extremely simple (both proposal and implementation) and almost completely described by
the email subject.
I think, this mini-RFC doesn't need 2-weeks discussion period, so I'm going to start the
vote on next week.
Thanks. Dmitry.