var_export on resource compatibility
commitb417649c83deb071c93e7e353ea418b711f0252e
authorJoel Marcey <joelm@fb.com>
Tue, 5 Jan 2016 15:50:35 +0000 (5 07:50 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Tue, 5 Jan 2016 16:30:39 +0000 (5 08:30 -0800)
tree766a8df61621ea44aee6ae261e8b726c0b3d8ea7
parent6fcae23d5bb8b2d26bacf0e52100bdd775f7073c
var_export on resource compatibility

Summary:
`var_export(resource)` on a `resource` returns `NULL` in PHP 5/7. We returned
an empty `array`. https://3v4l.org/EZSmE

Let's be compatible.

From php.net docs for `var_export`

> Variables of type resource couldn't be exported by this function.

There are a few different ways I think I could have gone here; I chose the way
with hopefully the most minimal impact to the variable serialization process.

Reviewed By: markw65

Differential Revision: D2798281

fb-gh-sync-id: 827dd35f865401d07ed9b3ef826bac066add1a2e
hphp/runtime/base/variable-serializer.cpp
hphp/test/slow/var_export/footer-bug-3.php
hphp/test/slow/var_export/resource.php
hphp/test/slow/var_export/resource.php.expect