repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Add binary field to deepcopy test
[hiphop-php.git]
/
hphp
/
test
/
quick
/
ctor_param_promotion.php
blob
9ef0624b1af00053678c13c1bdbbe633960e535f
1
<
?hh
2
3
//
4
// this works
5
//
6
class
A
{
7
public
$c
;
8
public function
__construct
(
protected
$a
,
public
$b
,
$arg
) {
9
$this
->
c
=
$arg
;
10
}
11
12
public function
getA
() :
mixed
{
13
return
$this
->
a
;
14
}
15
}
16
<<
__EntryPoint
>>
function
main
():
void
{
17
$a
=
new
A
(
'hi'
,
3
,
dict
[]);
18
foreach
(
$a
as
$k
=>
$v
) {
19
var_dump
(
$k
,
$v
);
20
}
21
var_dump
(
$a
->
getA
());
22
}