-
Notifications
You must be signed in to change notification settings - Fork 8k
BUG #73998: Numeric properties are not accessible from get_object_vars #2354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
get_object_vars hashes the numeric string when exporting it the symbols table In the symbols table numeric strings are not hashed, There numeric value is used as the hash value: |
|
It is causing a segfault in |
|
Fixed the issue with |
Zend/zend_builtin_functions.c
Outdated
| fast_copy = 1; | ||
| /* Check if the object has a numeric property, See Bug 73998 */ | ||
| ZEND_HASH_FOREACH_STR_KEY(properties, key) { | ||
| if (ZEND_HANDLE_NUMERIC(key, index)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to check that key is non-null.
|
Thanks, I have added a check to make sure the key is not null. |
Zend/zend_builtin_functions.c
Outdated
| } | ||
|
|
||
| if (fast_copy) { | ||
| /* fast copy */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is redundant now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, I will remove it.
| @@ -0,0 +1,19 @@ | |||
| --TEST-- | |||
| Bug #35239 (array_key_exists fails on arrays created by get_object_vars) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong bug ID here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I copied another test as a basic template! 😄 Thanks for catching that.
|
Merged via dd9cf23, thanks! |
No description provided.