mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Adding tests for abstract static methods
This commit is contained in:
26
tests/classes/abstract_static.phpt
Normal file
26
tests/classes/abstract_static.phpt
Normal file
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
A static abstrcat method may not be called
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class fail {
|
||||
abstract static function show();
|
||||
}
|
||||
|
||||
class pass extends fail {
|
||||
static function show() {
|
||||
echo "Call to function show()\n";
|
||||
}
|
||||
}
|
||||
|
||||
pass::show();
|
||||
fail::show();
|
||||
|
||||
echo "Done\n"; // shouldn't be displayed
|
||||
?>
|
||||
--EXPECTF--
|
||||
Call to function show()
|
||||
|
||||
Fatal error: Cannot call abstract method fail::show() in %s on line %d
|
||||
Reference in New Issue
Block a user