-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-10200: zif_get_object_vars: Assertion `!(((__ht)->u.flags & (1…
…<<2)) != 0)' failed. This occurs because the array of properties is a single element with an integer key, not an associative array. Therefore it is a packed array and thus the assumption the iteration macro makes is invalid. This restores the behaviour of PHP<8.2. Closes GH-10209 Co-authored-by: Deltik <deltik@gmx.com> Signed-off-by: George Peter Banyard <girgias@php.net>
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
GH-10200 (zif_get_object_vars: Assertion `!(((__ht)->u.flags & (1<<2)) != 0)' failed.) | ||
--FILE-- | ||
<?php | ||
|
||
$xmlData = <<<EOF | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<document>https://github.com/php/php-src/issues/10200 not encountered</document> | ||
EOF; | ||
|
||
$xml = simplexml_load_string($xmlData); | ||
$output = get_object_vars($xml); | ||
var_dump($output); | ||
|
||
?> | ||
--EXPECT-- | ||
array(1) { | ||
[0]=> | ||
string(59) "https://github.com/php/php-src/issues/10200 not encountered" | ||
} |
This file contains 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