mirror of
https://github.com/php/php-src.git
synced 2024-12-03 06:44:07 +08:00
25 lines
444 B
PHP
25 lines
444 B
PHP
--TEST--
|
|
Dynamic call for static methods dynamically named
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
static function foo() { return 'foo'; }
|
|
}
|
|
$classname = 'A';
|
|
$wrongClassname = 'B';
|
|
|
|
$methodname = 'foo';
|
|
|
|
echo $classname::$methodname()."\n";
|
|
|
|
echo $wrongClassname::$methodname()."\n";
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
foo
|
|
|
|
Fatal error: Uncaught Error: Class 'B' not found in %s044.php:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s044.php on line %d
|