php.net |  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
Votes:3
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nicolas dot grekas+php at gmail dot com
New email:
PHP Version: OS:

 

 [2018-07-30 08:46 UTC] 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']);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-31 21:08 UTC] cmb@php.net
I think that needs to be discussed on internals@ (and might even
need an RFC).  Nicolas?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 19:01:29 2024 UTC