Repository navigation
php 8.5: fix remaining deprecations - #228
Merged
Merged
Conversation
…sion for php 8.5 The old code mutated iterator values via offsetSet during traversal, replacing arrays with DefaultValue objects. When the iterator then tried to descend into those replaced values, RecursiveArrayIterator called new ArrayIterator($object) - deprecated in php 8.5. On older PHP this silently yielded no children (protected properties aren't iterable), so only the top-level array was ever processed by the iterator; nested arrays were handled later by recursive generate() calls. The new _prepareArrayValue() does the same thing explicitly.
falkenhawk
force-pushed
the
php85-remaining-deprecations
branch
from
April 7, 2026 13:04
74f067f to
becf619
Compare
falkenhawk
force-pushed
the
php85-remaining-deprecations
branch
3 times, most recently
from
April 7, 2026 13:52
fab7d6e to
d436b3a
Compare
pool.ntp.org is unreachable from GitHub Actions runners. Try time.windows.com first (confirmed working on CI), fall back to pool.ntp.org, only mark incomplete if both fail.
falkenhawk
force-pushed
the
php85-remaining-deprecations
branch
from
April 7, 2026 14:10
d436b3a to
621e915
Compare
Merged
falkenhawk
marked this pull request as ready for review
April 7, 2026 16:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes last 4 test errors on php 8.5 (after null offset fixes in #227):
1)
RecursiveArrayIteratorwith objects as backing arrayreplaced with simple recursive walk in
Zend_CodeGenerator_Php_Property_DefaultValue::generate().The old code mutated iterator values via
offsetSetduring traversal, replacing arrays withDefaultValueobjects. When the iterator then tried to descend into those replaced values,RecursiveArrayIteratorcallednew ArrayIterator($object)- deprecated in php 8.5. On older PHP this silently yielded no children (protected properties aren't iterable), so only the top-level array was ever processed by the iterator; nested arrays were handled later by recursivegenerate()calls. The new_prepareArrayValue()does the same thing explicitly.2)
SplPriorityQueue::__unserialize()return type mismatchadded
#[ReturnTypeWillChange]toZend_Stdlib_SplPriorityQueue::__unserialize()3)
xml_parser_free()deprecated since 8.5 (no-op since 8.0)guarded with
PHP_VERSION_ID < 80000inZend_Log_Writer_StreamTest4)
ord()with empty string deprecated in 8.5fread($this->_socket, 1)returns""when the NTP socket times out or the server sends an incomplete response. The code checks for timeout only AFTER callingord()on the result, soord("")fires before the timeout handler catches it. On older PHPord("")silently returned 0; php 8.5 deprecates this. Guarded inZend_TimeSync_Ntp::_read().5)
testTimesyncunreliable on CIpool.ntp.orgis unreachable from GitHub Actions runners (UDP 123 is not blocked - other NTP servers liketime.windows.comwork fine). Changed test to try multiple servers, falling back gracefully.followup to #227