Fix var_export for resources

Debug builds hit an assert, and release builds would output
something like array(}.
Esse commit está contido em:
mwilliams
2013-07-02 15:52:14 -07:00
commit de Sara Golemon
commit b2f7473aeb
3 arquivos alterados com 12 adições e 1 exclusões
+2 -1
Ver Arquivo
@@ -69,6 +69,7 @@ void VariableSerializer::getResourceInfo(String &rsrcName, int &rsrcId) {
void VariableSerializer::setResourceInfo(CStrRef rsrcName, int rsrcId) {
m_rsrcName = rsrcName;
m_rsrcId = rsrcId;
m_objCode = 0;
}
String VariableSerializer::serialize(CVarRef v, bool ret) {
@@ -849,7 +850,7 @@ void VariableSerializer::writeArrayFooter() {
case Type::VarExport:
case Type::PHPOutput:
indent();
if (info.is_object) {
if (info.is_object && m_objCode) {
if (m_objCode == 'O') {
m_buf->append("))");
} else {
+8
Ver Arquivo
@@ -0,0 +1,8 @@
<?php
function test() {
$f = fopen(__FILE__, "r");
var_export($f);
}
test();
@@ -0,0 +1,2 @@
array (
)