hhvm
hhvm copied to clipboard
ArrayObject serialization isn't compatible with Zend PHP
<?php
$a = new ArrayObject();
$a["foo"] = 42;
var_dump(serialize($a));
Zend outputs:
string(60) "C:11:"ArrayObject":36:{x:i:0;a:1:{s:3:"foo";i:42;};m:a:0:{}}"
HHVM outputs:
string(123) "C:11:"ArrayObject":99:{a:3:{s:7:"storage";a:1:{s:3:"foo";i:42;}s:5:"flags";i:0;s:13:"iteratorClass";s:13:"ArrayIterator";}}"
Yeah, we aren't going to be serialize compat with php5. We should be internally consistent with ourselves. We try, but many of our internals differ. Is this breaking your stuff?
Ah, sure. Its not a must fix for me - I can workaround this issue. If I submitted a PR to bring this to parity with Zend would it be accepted? I admit, it is fairly nasty that ArrayObjects aren't serialized like normal objects by spl/Zend.
@jmarrama yup, a PR would be taken, but it is an explicit non-goal to be serialize compat in general.