summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/typed_properties_060.phpt
blob: 559349b7a97b17d1877adfa354e244d3075dbcb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Test typed properties work fine with simple inheritance
--FILE--
<?php

class A {
	public int $a = 1;
}
class B extends A {}

$o = new B;
var_dump($o->a);
$o->a = "a";

?>
--EXPECTF--
int(1)

Fatal error: Uncaught TypeError: Typed property A::$a must be int, string used in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d