Req #76681 [Opn]: Make unserialize() handle a new "callback" option entry
| From: | cmb@php.net | Date: | Tue, 31 Jul 2018 21:08:06 +0000 |
| Subject: | Req #76681 [Opn]: Make unserialize() handle a new "callback" option entry | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216531@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76681&edit=1
ID: 76681
Updated by: cmb@php.net
Reported by: nicolas dot grekas+php at gmail dot com
Summary: Make unserialize() handle a new "callback" option
entry
Status: Open
Type: Feature/Change Request
Package: Scripting Engine problem
PHP Version: Next Minor Version
Block user comment: N
Private report: N
New Comment:
I think that needs to be discussed on internals@ (and might even
need an RFC). Nicolas?
Previous Comments:
------------------------------------------------------------------------
[2018-07-30 08:46:52] nicolas dot grekas+php at gmail dot com
Description:
------------
Right now, the unserialize callback must be defined using an ini setting.
It would be more convenient to be able to set it via new option.
(This could potentially also allow setting it to a Closure?)
BEFORE:
$unserializeCallbackHandler = ini_set('unserialize_callback_func',
'my_unserialize_callback');
try {
unserialize($value);
} finally {
ini_set('unserialize_callback_func', $unserializeCallbackHandler);
}
AFTER:
unserialize($value, ['callback' => 'my_unserialize_callback']);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76681&edit=1