Arquivos
hhvm/hphp/test/quick/ctor_param_promotion_genericgood.php
T
Dario Russi ef99ac3445 Allow parameter promotion in constructors
Extend PHP to allow constructor paramters to be promoted to fields. Reduce plumbing of class declaration and helps productivity.
2013-07-06 11:12:21 -07:00

9 linhas
117 B
PHP

<?hh
class A<T> {
function __construct(public Vector<T> $f) {}
}
$a = new A<int>(Vector{1, 2, 3});
var_dump($a);