summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/typed_properties_088.phpt
blob: b2f626d3dab893c435feecc1ff88d7874089f643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--TEST--
Check for correct invalidation of prop_info cache slots
--FILE--
<?php

class A {
    public int $prop;
}
class B {
    public $prop;
}

function test($obj) {
    $obj->prop = "42";
    var_dump($obj);
}

test(new A);
test(new B);

?>
--EXPECT--
object(A)#1 (1) {
  ["prop"]=>
  int(42)
}
object(B)#1 (1) {
  ["prop"]=>
  string(2) "42"
}