php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34504 unserialize return is different
Submitted: 2005-09-15 00:45 UTC Modified: 2005-09-15 01:42 UTC
From: wkonkel at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.0.5 OS: redhat
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wkonkel at gmail dot com
New email:
PHP Version: OS:

 

 [2005-09-15 00:45 UTC] wkonkel at gmail dot com
Description:
------------
In php 5.0.4 and prior, this code snippet worked.  In php 5.0.5, it now returns an error.

A work around is to change the code to:

$obj = unserialize($data);
echo array_pop($obj);

Reproduce code:
---------------
<?

$data = serialize(array('test', 'test2'));
echo array_pop(unserialize($data));

?>


Expected result:
----------------
test2

Actual result:
--------------
Fatal error: Only variables can be passed by reference in /var/www/bountysource/public/test.php on line 4


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-15 01:42 UTC] tony2001@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Please search bug db before submitting new reports.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 04 11:00:01 2025 UTC