mysqli has an uncommon approach to 64-bit compatibility:
it will convert numbers that can't be represented on 32-bit
platforms to a string.
This is documented at
https://www.php.net/manual/en/mysqli-stmt.affected-rows.php#refsect1-mysqli-stmt.affected-rows-returnvalues
So if there's a query to a remote mysqli server that affects
more than 2.2 billion rows, then the opcache inference might be
incorrect.
(It's possible to add a MAY_BE_STRING_ON_32_BIT_PLATFORM bitflag macro to
account for this, but I don't think there's a need or want to?)
Patches 3162285b86
This is based on the list of php 7.4 functions using
MYSQLI_RETURN_LONG_INT in mysqli_api.c
https://www.php.net/manual/en/mysqli.get-charset.php
tests/mysqli_field_seek.phpt has a test of this returning an object.
Looking at the source in ext/mysqli/mysqli_nonapi.c,
this should be object|null, not array|null
This might actually cause bugs in opcache's inferences,
(no proof of this)
so it might make sense to pull this patch into an earlier minor version.
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
We need to check result_use rather than result_def for a null zval.
Previously we were later assuming that the null zval is really a
partial array, which does not go well.
We cannot replace an op1_def opcode with an ASSIGN, if it also has
a used res_def. Usually this doesn't happen because the res_def use
can be eliminated first. The example is a case where operand replacement
on the res_def use fails.
Add MUL back to the list and instead make the entire optimization
depend on IGNORE_OVERLOADING, which is there exactly so we can make
these kinds of assumptions.
The cache size could be off by 4, if we're on a 32-bit system and
the slot had to be bumped for alignment reasons.
I wasn't able to reproduce the issue reported in bug #77287, but I
think this might be the cause.
Correctly handle the case of duplicate predecessors, by removing the
duplicate predecessor and corresponding phi node operands.
For the future, it would be better to instead allow duplicate
predecessors and avoid this kind of fragile code...
Instead of juggling with this problem during literal compaction,
make sure that we always initialize Z_EXTRA for literals, which
seems like the more robust solution.
Remove invalid assertion: A block can have multiple switch frees,
so if we don't do live range block splitting, it is not necessarily
true that the free is located at the start of a block.