Re: ArrayObject - no prop access after deserialization



Thomas Mlynarczyk wrote:
Hello,

This code

$o = new ArrayObject(
array( 'foo' => 1, 'bar' => 2 ),
ArrayObject::ARRAY_AS_PROPS );

var_dump( $o['foo'] );
var_dump( $o->foo );

$o = unserialize( serialize( $o ) );

var_dump( $o['foo'] );
var_dump( $o->foo );

outputs

int(1)
int(1)
int(1)
NULL

(tested with PHP 5.2.4 on Windows). I had expected another int(1) instead of NULL. It seems that the ARRAY_AS_PROPS flag does not "survive" the serialization. What am I doing wrong?

Greetings,
Thomas



Hi, Thomas.

Hmmm, this looks like a bug. Not surprising since much of this code is fairly new (and probably not heavily used yet).

I'd recommend you submit a bug report on it. It will go well with the other recent reported bugs on ArrayObject.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • RE: Notepad Disappears!
    ... Are you telling me that you can't pass my bug report along? ... MS would probably say the way they fixed that bug was to 'upgrade Windows'. ... This is a Windows XP bug, not a Notepad bug. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: How stable is 1.5?
    ... > I've got Java 1.5.0_05-b05 running on Windows XP and Windows 2000 and it's ... that an "unexpected error has been detected by HotSpot Virtual Machine". ... For those who imagine that this bug was fixed after Sun responding to my ... time to helping find their bug but they never accepted a bug report. ...
    (comp.lang.java.programmer)
  • Re: Want to log bug against windows xp
    ... I am Karthikeyan S, as a Tester. ... I want to log a bug against windows XP. ... bug report. ...
    (microsoft.public.windowsxp.general)
  • Re: Dapper is LESS stable than Breezy.
    ... satisfactory answers to this problem. ... things might help you narrow down the problem in your bug report. ... Windows. ...
    (Ubuntu)
  • Re: [opensuse] Why are Novell guys closing perfectly valid bugs as WONTFIX due to their laziness ?
    ... That means that WONTFIX acknowledges that a bug as reported is indeed a valid ... In the general case (not being specific about the bug report you quoted later ... The problem could be fixed, but the cost for the fix (the amount of work ... involve major rewrites of upstream software. ...
    (SuSE)

Loading