Improve behavior when serializing unserializable builtin classes
commitd4023e78cda610d104787fbc1c751d06bcf272d9
authorJordan DeLong <jdelong@fb.com>
Sun, 13 Apr 2014 01:40:35 +0000 (12 18:40 -0700)
committerSara Golemon <sgolemon@fb.com>
Mon, 14 Apr 2014 23:58:59 +0000 (14 16:58 -0700)
tree966f3a7e3822dabe6773c28472da4021c280b154
parenta9b08bd9441a83fa575e44320f821b30ea4223bb
Improve behavior when serializing unserializable builtin classes

Instead of serializing an object of some unrelated type,
serialize a null.  The old way had a dynamic property telling you
which type you messed up with, but this is not nearly as useful as a
stacktrace at serialize time, as the code doing the serialization is
generally going to be the code making the error.  "Null" is also going
to make this easier to deal with for private property inference---if
we've determined that a private property has any object type,
currently either it is going to be nullable or one of the collection
types (which are known to be serializable).  Presumably the old dummy
continuation method was also easier for private property inference
because dummy continuations derived from Continuation?

Reviewed By: @jano

Differential Revision: D1274152
48 files changed:
hphp/runtime/base/object-data.cpp
hphp/runtime/base/type-variant.cpp
hphp/system/php/lang/stdClass.php
hphp/system/systemlib.h
hphp/test/quick/builtin_extension_DOMAttr.php.expectf
hphp/test/quick/builtin_extension_DOMCDATASection.php.expectf
hphp/test/quick/builtin_extension_DOMCharacterData.php.expectf
hphp/test/quick/builtin_extension_DOMComment.php.expectf
hphp/test/quick/builtin_extension_DOMDocument.php.expectf
hphp/test/quick/builtin_extension_DOMDocumentFragment.php.expectf
hphp/test/quick/builtin_extension_DOMDocumentType.php.expectf
hphp/test/quick/builtin_extension_DOMElement.php.expectf
hphp/test/quick/builtin_extension_DOMEntity.php.expectf
hphp/test/quick/builtin_extension_DOMEntityReference.php.expectf
hphp/test/quick/builtin_extension_DOMImplementation.php.expectf
hphp/test/quick/builtin_extension_DOMNamedNodeMap.php.expectf
hphp/test/quick/builtin_extension_DOMNode.php.expectf
hphp/test/quick/builtin_extension_DOMNodeIterator.php.expectf
hphp/test/quick/builtin_extension_DOMNodeList.php.expectf
hphp/test/quick/builtin_extension_DOMNotation.php.expectf
hphp/test/quick/builtin_extension_DOMProcessingInstruction.php.expectf
hphp/test/quick/builtin_extension_DOMText.php.expectf
hphp/test/quick/builtin_extension_DOMXPath.php.expectf
hphp/test/quick/builtin_extension_DateInterval.php.expectf
hphp/test/quick/builtin_extension_DateTime.php
hphp/test/quick/builtin_extension_DateTimeZone.php.expectf
hphp/test/quick/builtin_extension_LibXMLError.php.expectf
hphp/test/quick/builtin_extension_Memcache.php.expectf
hphp/test/quick/builtin_extension_Memcached.php.expectf
hphp/test/quick/builtin_extension_SQLite3.php.expectf
hphp/test/quick/builtin_extension_SQLite3Result.php.expectf
hphp/test/quick/builtin_extension_SQLite3Stmt.php.expectf
hphp/test/quick/builtin_extension_SimpleXMLElement.php.expectf
hphp/test/quick/builtin_extension_SimpleXMLElementIterator.php.expectf
hphp/test/quick/builtin_extension_SoapClient.php.expectf
hphp/test/quick/builtin_extension_SoapHeader.php.expectf
hphp/test/quick/builtin_extension_SoapParam.php.expectf
hphp/test/quick/builtin_extension_SoapServer.php.expectf
hphp/test/quick/builtin_extension_SoapVar.php.expectf
hphp/test/quick/builtin_extension_XMLReader.php.expectf
hphp/test/quick/builtin_extension_XMLWriter.php.expectf
hphp/test/quick/builtin_extensions.inc
hphp/test/quick/continuation_serialize.php.expectf
hphp/test/slow/apc/1824.php.expect [deleted file]
hphp/test/slow/apc/1824.php.expectf [new file with mode: 0644]
hphp/test/slow/apc/1825.php.expectf
hphp/test/slow/ext_datetime/serialize.php
hphp/test/slow/ext_datetime/serialize.php.expect