You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Safely converts a serialized string into a native PHP object while protecting against Object Injection attacks.
Usage
serialToObject(string $serial): array|object
Parameters
serial (string)
: The serialized string to decode and convert into an object.
Return Value
(array|object)
: Returns a PHP object (or array depending on structure) on success.
: Returns an empty array ([]) or object if the input is malformed, corrupted, or decodes into a non-array scalar value.
📌 Chains serialToArray and arrayToObject to safely parse serialized input while preventing PHP Object Injection vulnerabilities.