diff options
author | Ilija Tovilo <ilija.tovilo@me.com> | 2020-06-10 23:10:18 +0200 |
---|---|---|
committer | Ilija Tovilo <ilija.tovilo@me.com> | 2021-03-17 19:08:03 +0100 |
commit | 269c8dac1d56ee85d71ae94d9b28dd7d8e8de7b7 (patch) | |
tree | 810ac41b2157ff4e8063f9696f97e1a9d77837c4 /Zend/tests/enum/non-backed-enum-with-int-value.phpt | |
parent | a6fc427b8c51015c16541c112a26dd06bd75e99e (diff) | |
download | php-git-269c8dac1d56ee85d71ae94d9b28dd7d8e8de7b7.tar.gz |
Implement enums
RFC: https://wiki.php.net/rfc/enumerations
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Closes GH-6489.
Diffstat (limited to 'Zend/tests/enum/non-backed-enum-with-int-value.phpt')
-rw-r--r-- | Zend/tests/enum/non-backed-enum-with-int-value.phpt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/tests/enum/non-backed-enum-with-int-value.phpt b/Zend/tests/enum/non-backed-enum-with-int-value.phpt new file mode 100644 index 0000000000..4932e63d18 --- /dev/null +++ b/Zend/tests/enum/non-backed-enum-with-int-value.phpt @@ -0,0 +1,12 @@ +--TEST-- +Non-backed enum errors when case has int value +--FILE-- +<?php + +enum Foo { + case Bar = 1; +} + +?> +--EXPECTF-- +Fatal error: Case Bar of non-backed enum Foo must not have a value, try adding ": int" to the enum declaration in %s on line %d |