php-src/Zend/tests/enum/non-backed-enum-with-string-value.phpt
Ilija Tovilo 269c8dac1d
Implement enums
RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6489.
2021-03-17 19:08:03 +01:00

12 lines
257 B
PHP

--TEST--
Non-backed enum errors when case has string value
--FILE--
<?php
enum Foo {
case Bar = 'Bar';
}
?>
--EXPECTF--
Fatal error: Case Bar of non-backed enum Foo must not have a value, try adding ": string" to the enum declaration in %s on line %d