diff --git a/hphp/runtime/base/type_array.cpp b/hphp/runtime/base/type_array.cpp index 613fea592..bc5d3a0ab 100644 --- a/hphp/runtime/base/type_array.cpp +++ b/hphp/runtime/base/type_array.cpp @@ -703,7 +703,7 @@ Array Array::keys(CVarRef search_value /* = null_variant */, Array Array::values() const { ArrayInit ai(size(), ArrayInit::vectorInit); for (ArrayIter iter(*this); iter; ++iter) { - ai.set(iter.secondRef()); + ai.set(withRefBind(iter.secondRef())); } return ai.create(); } diff --git a/hphp/test/quick/array_values.php b/hphp/test/quick/array_values.php new file mode 100644 index 000000000..483c9625b --- /dev/null +++ b/hphp/test/quick/array_values.php @@ -0,0 +1,6 @@ + + &string(1) "b" +}