diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-24 13:18:28 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-06-05 15:15:51 +0200 |
commit | 064b4644484d38e9dce40aef7e8e0e8190e9d863 (patch) | |
tree | ceb34fd4bc375ea0accdf3f8b1b15c389c7e103a /Zend/tests/ctor_promotion_abstract.phpt | |
parent | 91f283a0bfc6792d84fb9a6361e21f6f33769c4d (diff) | |
download | php-git-064b4644484d38e9dce40aef7e8e0e8190e9d863.tar.gz |
Implement "Constructor Promotion" RFC
RFC: https://wiki.php.net/rfc/constructor_promotion
Closes GH-5291.
Diffstat (limited to 'Zend/tests/ctor_promotion_abstract.phpt')
-rw-r--r-- | Zend/tests/ctor_promotion_abstract.phpt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/tests/ctor_promotion_abstract.phpt b/Zend/tests/ctor_promotion_abstract.phpt new file mode 100644 index 0000000000..937e247acd --- /dev/null +++ b/Zend/tests/ctor_promotion_abstract.phpt @@ -0,0 +1,12 @@ +--TEST-- +Constructor promotion cannot be used inside an abstract constructor +--FILE-- +<?php + +abstract class Test { + abstract public function __construct(public int $x); +} + +?> +--EXPECTF-- +Fatal error: Cannot declare promoted property in an abstract constructor in %s on line %d |