diff --git a/hphp/runtime/base/builtin_functions.cpp b/hphp/runtime/base/builtin_functions.cpp index c72220eb6..7ace9bb8d 100644 --- a/hphp/runtime/base/builtin_functions.cpp +++ b/hphp/runtime/base/builtin_functions.cpp @@ -453,7 +453,7 @@ void throw_collection_modified() { void throw_collection_property_exception() { Object e(SystemLib::AllocInvalidOperationExceptionObject( - "Cannot access property on a collection")); + "Cannot access a property on a collection")); throw e; } diff --git a/hphp/runtime/ext/ext_collections.cpp b/hphp/runtime/ext/ext_collections.cpp index 3b76c75f9..ec26ba312 100644 --- a/hphp/runtime/ext/ext_collections.cpp +++ b/hphp/runtime/ext/ext_collections.cpp @@ -4567,7 +4567,7 @@ void c_PairIterator::t_rewind() { throw_collection_property_exception(); \ } \ bool c_##cls::t___isset(Variant name) { \ - throw_collection_property_exception(); \ + return false; \ } \ Variant c_##cls::t___unset(Variant name) { \ throw_collection_property_exception(); \ diff --git a/hphp/test/slow/collection_classes/805.php b/hphp/test/slow/collection_classes/805.php index 1b646d380..69f20f570 100644 --- a/hphp/test/slow/collection_classes/805.php +++ b/hphp/test/slow/collection_classes/805.php @@ -8,14 +8,25 @@ try { $obj = new $cls; try { $x = $obj->foo; + echo "get: "; + var_dump($x); } catch (RuntimeException $e) { - echo $i; + echo "get throws, i = "; + var_dump($i); + } + try { + $x = isset($obj->foo); + echo "isset: "; + var_dump($x); + } catch (RuntimeException $e) { + echo "isset throws, i = "; + var_dump($i); } - ++$i; try { $obj->foo = 123; } catch (RuntimeException $e) { - echo $i; + echo "set throws, i = "; + var_dump($i); } ++$i; } diff --git a/hphp/test/slow/collection_classes/805.php.expect b/hphp/test/slow/collection_classes/805.php.expect index 14bb7d264..56af62f9d 100644 --- a/hphp/test/slow/collection_classes/805.php.expect +++ b/hphp/test/slow/collection_classes/805.php.expect @@ -1 +1,10 @@ -012345Done +get throws, i = int(0) +isset: bool(false) +set throws, i = int(0) +get throws, i = int(1) +isset: bool(false) +set throws, i = int(1) +get throws, i = int(2) +isset: bool(false) +set throws, i = int(2) +Done