summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/typed_properties_015.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/type_declarations/typed_properties_015.phpt')
-rw-r--r--Zend/tests/type_declarations/typed_properties_015.phpt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/tests/type_declarations/typed_properties_015.phpt b/Zend/tests/type_declarations/typed_properties_015.phpt
new file mode 100644
index 0000000000..ac11c0fe3e
--- /dev/null
+++ b/Zend/tests/type_declarations/typed_properties_015.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Test typed properties disallow incorrect type initial value (object)
+--FILE--
+<?php
+class Foo {
+ public stdClass $bar = null;
+}
+?>
+--EXPECTF--
+Fatal error: Default value for property of type stdClass may not be null. Use the nullable type ?stdClass to allow null default value in %s on line %d