T_NUM_STRING follows the rules of symtable numeric string
conversion. If the offset isn't an integer under those rules, it
is treated as a string. This should apply to negated T_NUM_STRINGs
as well.
This fixes the following issues:
* "use function" and "use const" inside namespaced code were checking
for conflicts against class imports. Now they always check against
the correct symbol type.
* Symbol conflicts are now always checked within a single file only.
Previously class uses inside namespaced code were checked globally.
This behavior is illegal because symbols from other files are not
visible if opcache is used, resulting in behavioral discrepancies.
Additionally this made the presence/absence of symbol errors dependent
on autoloading order, which is volatile.
* The "single file" restriction is now enforced by collecting defined
symbols inside a separate hash table. Previously it was enforced
(for the non-namespaced case) by comparing the filename of the
symbol declaration. However this is inaccurate if the same filename
is used multiple times, such as may happen if eval() is used.
* Additionally the previous approach relies on symbols being registered
at compile-time, which is not the case for late-bound classes, which
makes the behavior dependent on class declaration order, as well as
opcache (which may cause delayed early-binding).
* Lastly, conflicts are now consistently checked for conditionally
defined symbols. Previously only declaration-after-use conflicts were
checked in this case. Now use-after-declaration conflicts are
detected as well.
This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization.
Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
"called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this.
Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL).
Some code might need to be adopted to support this change.
Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
Squashed commit of the following:
commit e05d3b6732
Author: Andrea Faulds <ajf@ajf.me>
Date: Wed Mar 30 01:43:35 2016 +0100
UPGRADING and NEWS
commit 6caf1d4585
Author: Andrea Faulds <ajf@ajf.me>
Date: Sun Mar 20 21:18:33 2016 +0000
Fixes
commit 6dadb1b0ef
Author: Andrea Faulds <ajf@ajf.me>
Date: Sun Feb 14 02:15:01 2016 +0000
Add test for numeric string errors in assignment
commit bd5f04e8dd
Author: Andrea Faulds <ajf@ajf.me>
Date: Sat Feb 13 23:53:05 2016 +0000
Add test for numeric string errors
commit c72e92f16d
Author: Andrea Faulds <ajf@ajf.me>
Date: Tue Jan 26 23:28:33 2016 +0000
Add test for scientific notation in integer operations
commit d94c08852d
Author: Andrea Faulds <ajf@ajf.me>
Date: Sun Feb 14 01:25:57 2016 +0000
Disable optimiser evaluation for numeric string errors
commit 30ee954ed1
Author: Andrea Faulds <ajf@ajf.me>
Date: Sun Feb 14 01:46:25 2016 +0000
fixup
commit a6403b79e0
Author: Andrea Faulds <ajf@ajf.me>
Date: Sat Feb 13 22:00:27 2016 +0000
Do not convert error-causing numeric strings ahead-of-time
commit f9dc354014
Author: Andrea Faulds <ajf@ajf.me>
Date: Sat Feb 13 19:15:38 2016 +0000
Disable compile-time evaluation for numeric string errors
commit e05b0cc849
Author: Andrea Faulds <ajf@ajf.me>
Date: Fri Feb 5 11:42:26 2016 +0000
Make _zval_get_long_func_noisy function for inlining
commit 84d66321a5
Author: Andrea Faulds <ajf@ajf.me>
Date: Tue Jan 26 23:10:00 2016 +0000
Update tests
commit 5ac4a0cc4b
Author: Andrea Faulds <ajf@ajf.me>
Date: Tue Jan 26 22:08:19 2016 +0000
Use is_numeric_string_ex for zval_get_long etc.
commit c21f088485
Author: Andrea Faulds <ajf@ajf.me>
Date: Thu Jan 7 21:13:04 2016 +0000
Update tests
commit 63e214cf81
Author: Andrea Faulds <ajf@ajf.me>
Date: Wed Jan 6 00:28:01 2016 +0000
Warn on non-/bad numeric strings in arithmetic
This means we no longer allocate an unused VAR for the retval of
instructions that support unused results.
Nearly all instructions already used the result variable only if
it was used. The only exception to this was the return value
variable for internal function call results. I've adjusted the code
to use a stack zval for the unused return case now. As we have
retval specialization now, we know that it doesn't matter.