|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76681 Make unserialize() handle a new "callback" option entry
Submitted: 2018-07-30 08:46 UTC Modified: 2018-07-31 21:08 UTC
Avg. Score:4.3 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: nicolas dot grekas+php at gmail dot com Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: Next Minor Version OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
8 + 18 = ?
Subscribe to this entry?

 [2018-07-30 08:46 UTC] nicolas dot grekas+php at gmail dot com
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?)

$unserializeCallbackHandler = ini_set('unserialize_callback_func', 'my_unserialize_callback');
try {
} finally {
    ini_set('unserialize_callback_func', $unserializeCallbackHandler);

unserialize($value, ['callback' => 'my_unserialize_callback']);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-31 21:08 UTC]
I think that needs to be discussed on internals@ (and might even
need an RFC).  Nicolas?
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jan 27 08:05:53 2023 UTC