-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Backport Ref<T> to 3.30 * Remove hhvm-nightly from the tests HHVM 4.41-dev is smiling upon thou hsl 3.30 😜. * (Re)target hhvm 3.30-latest in tests Travis picks the newest stable hhvm is you don't say anything.
- Loading branch information
1 parent
9a5f26a
commit ef4a4b1
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
language: php | ||
php: | ||
- hhvm | ||
- hhvm-nightly | ||
- hhvm-3.30 | ||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?hh // strict | ||
/* | ||
* Copyright (c) 2004-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
|
||
namespace HH\Lib; | ||
|
||
/** Wrapper class for getting object (byref) semantics for a value type. | ||
* | ||
* This is especially useful for mutating values outside of a lambda's scope. | ||
* | ||
* In general, it's preferable to refactor to use return values or `inout` | ||
* parameters instead of using this class - however, a `Ref` of a Hack array | ||
* is generally preferable to a Hack collection - e.g. prefer `Ref<vec<T>>` | ||
* over `Vector<T>`. | ||
* | ||
* `C\reduce()` and `C\reduce_with_key()` can also be used in some situations | ||
* to avoid this class. | ||
*/ | ||
final class Ref<T> { | ||
<<__RxShallow>> | ||
public function __construct(public T $value) {} | ||
} |