php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27120 Serialization replaces PHP 5 object references with PHP 4-style "references"
Submitted: 2004-02-02 03:58 UTC Modified: 2004-02-03 09:07 UTC
From: reiersol at online dot no Assigned: stas (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2004-02-02 (dev) OS: RedHat 9.0
Private report: No CVE-ID: None
 [2004-02-02 03:58 UTC] reiersol at online dot no
Description:
------------
This bug is actually the "fixed" version of bug #25975. I'm deliberately reporting it as a new bug, since the history of bug #25975 seems to be causing confusion.

The bug fix is not satisfactory, since the objects still do not behave the same way before and after serialization. I believe this has serious consequences for using objects in session-based applications.

By uncommenting the two commented lines in the code, you can run the test without serialization. This produces the "expected result".

Reproduce code:
---------------
http://home.online.no/~reiersol/referencetest.html

Expected result:
----------------
TestCase ReferenceTest->testChangeObject() passed
TestCase ReferenceTest->testReplaceObject() passed


Actual result:
--------------
TestCase ReferenceTest->testChangeObject() passed
TestCase ReferenceTest->testReplaceObject() failed: expected true, actual false


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-03 01:55 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

One without any includes, thankyouverymuch..

 [2004-02-03 07:02 UTC] reiersol at online dot no
I'm afraid I'm not willing to go through another round of spending hours developing another example, and then another one. I urge you to try the example as it is.

PHPUnit is on PEAR. It's a test framework. People who do
testing and debugging should be willing and able to install it. It's also a good way to get more precision so we know we're not overlooking anything or reading the results differently.
 [2004-02-03 08:14 UTC] stas@php.net
OK, there seems indeed to be a problem in serialize - it sets is_ref for bound variables even if they weren't is_ref=1 before. Will check that.
 [2004-02-03 09:07 UTC] stas@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Dec 10 10:04:15 2022 UTC