unserialization: Documented allowed-classes option with enums#5585
Open
edorian wants to merge 1 commit into
Open
unserialization: Documented allowed-classes option with enums#5585edorian wants to merge 1 commit into
edorian wants to merge 1 commit into
Conversation
TimWolla
requested changes
May 26, 2026
|
|
||
| <para> | ||
| The <literal>allowed_classes</literal> option of | ||
| <function>unserialize</function> does not affect enums. |
Member
There was a problem hiding this comment.
Suggested change
| <function>unserialize</function> does not affect enums. | |
| <function>unserialize</function> does not affect <link linkend="language.enumerations">Enumerations</link>. |
And ditto in the other file.
| value a warning will be issued and &false; returned.</para> | ||
|
|
||
| <para> | ||
| The <literal>allowed_classes</literal> option of |
Member
There was a problem hiding this comment.
Suggested change
| The <literal>allowed_classes</literal> option of | |
| The <literal>"allowed_classes"</literal> option of |
Not sure about this one, but <literal> feels like it should be combined with "". Perhaps check if there's precedent.
Member
There was a problem hiding this comment.
There isn't really a policy for this. It is done, but sometimes.. and mostly for cases like "0" not really for options or arguments. So I am more leaning towards omitting in this specific case.
jordikroon
requested changes
May 26, 2026
| On deserialization, if an enum and case cannot be found to match a serialized | ||
| value a warning will be issued and &false; returned.</para> | ||
|
|
||
| <para> |
Member
There was a problem hiding this comment.
Suggested change
| <para> | |
| <simpara> |
| <para> | ||
| The <literal>allowed_classes</literal> option of | ||
| <function>unserialize</function> does not affect enums. | ||
| </para> |
Member
There was a problem hiding this comment.
Suggested change
| </para> | |
| </simpara> |
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.
Following the discussion in php/php-src#22059
As enums are technically classes, and the allowed-classes option set to "false" does not affect them this piece of clarification should help document the expected (and current) behavior.