php-src/tests/classes/abstract_not_declared.phpt
DanielEScherzer 0b94cf65e4
GH-16067: prevent invalid abstract during compilation of methods (GH-16069)
For classes that are not declared `abstract`, produce a compiler error for any
`abstract` methods. For anonymous classes, since they cannot be made abstract,
the error message is slightly different.

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-10-23 15:04:18 +02:00

13 lines
288 B
PHP

--TEST--
ZE2 An abstract class must be declared abstract
--FILE--
<?php
class fail {
abstract function show();
}
echo "Done\n"; // shouldn't be displayed
?>
--EXPECTF--
Fatal error: Class fail declares abstract method show() and must therefore be declared abstract in %s on line %d