Problems with serializing Zend\Stdlib\ArrayObject #6089

Closed
koenpunt opened this Issue Apr 5, 2014 · 7 comments

Projects

None yet

2 participants

@koenpunt
koenpunt commented Apr 5, 2014

The simple example below fails with:

Warning: in_array() expects parameter 2 to be array, null given in Zend/Stdlib/ArrayObject.php on line 100
$ar = new Zend\Stdlib\ArrayObject();
$ar->foo = 'bar';
$ar['bar'] = 'foo';

$serialized = serialize($ar);
$unserialized = unserialize($serialized);

I tried to fix it in #6088, but without success..

@Ocramius Ocramius added a commit to Ocramius/zf2 that referenced this issue Apr 6, 2014
@Ocramius Ocramius Hotfix for #6089 - `protectedProperties` of ArrayObject are maintaine…
…d on serialization
da29799
@Ocramius Ocramius added this to the 2.3.1 milestone Apr 6, 2014
@Ocramius Ocramius self-assigned this Apr 6, 2014
Member
Ocramius commented Apr 6, 2014

@koenpunt can you check #6089?

Member

Close, please poke me if the issue persists, @koenpunt

@Ocramius Ocramius closed this Apr 10, 2014
@weierophinney weierophinney added a commit that referenced this issue Apr 14, 2014
@weierophinney weierophinney Merge branch 'hotfix/6092'
Close #6092
Fixes #6089
9924c89

Still (or again) having issues with this, using the same example as mentioned before...

Member

@koenpunt there's a test case for this one - could you adapt it to the failure that you are experiencing?

Oh, I'm not using the latest version because zend-paginator keeps the composer version back to 2.3.0...

Member

Ah yes, see #6397

Resolved it for now by specifying as follows:

{
 "zendframework/zend-stdlib": "2.3.1 as 2.3.0",
 "zendframework/zend-paginator": "2.3.*",
}
@gianarb gianarb pushed a commit to zendframework/zend-stdlib that referenced this issue May 15, 2015
@Ocramius Ocramius Adding failing test case for zendframework/zendframework#6089 - seria…
…lization causes notices
ce5b132
@gianarb gianarb pushed a commit to zendframework/zend-stdlib that referenced this issue May 15, 2015
@Ocramius Ocramius Hotfix for zendframework/zendframework#6089 - `protectedProperties` o…
…f ArrayObject are maintained on serialization
6cf691d
@weierophinney weierophinney added a commit to zendframework/zend-stdlib that referenced this issue May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#6092 from Ocramius/hot…
…fix/zendframework/zf2#6089-arrayobject-serialization

Hotfix for zendframework/zendframework#6089 - ArrayObject serialization doesn't restore `protectedProperties`
60d73cb
@weierophinney weierophinney added a commit to zendframework/zend-stdlib that referenced this issue May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/6092' 4ac816f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment