Skip to content

Commit 260a250

Browse files
committed
HHVM does not allow for current() on an object
As it (correctly) gets serialized to an object, we need to cast to an array so that we can call current. Issue: facebook/hhvm#6160
1 parent d67bb73 commit 260a250

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/bson/bson-javascript-001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ $js = new $classname("function foo(bar) {var baz = bar; var bar = foo; return ba
1212
$jswscope = new $classname("function foo(bar) {var baz = bar; var bar = foo; return bar; }", array("foo" => 42));
1313
$tests = array(
1414
array("js" => $js),
15-
array("jswscope" => $jswscope),
15+
array("js" => $jswscope),
1616
);
1717

1818
foreach($tests as $n => $test) {
1919
echo "Test#{$n}", "\n";
2020
$s = fromPHP($test);
2121
$testagain = toPHP($s);
22-
var_dump(current($test) instanceof $classname);
23-
var_dump(current($testagain) instanceof $classname);
22+
var_dump($test['js'] instanceof $classname);
23+
var_dump($testagain->js instanceof $classname);
2424
}
2525

2626
?>

0 commit comments

Comments
 (0)