indirect_call_string_002.phpt [plain text]
--TEST--
Indirect call with empty class and/or method name.
--FILE--
<?php
class TestClass
{
public static function __callStatic($method, array $args)
{
var_dump($method);
}
}
$callback = ['TestClass', ''];
$callback();
$callback = 'TestClass::';
$callback();
$callback = ['', 'method'];
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
$callback = '::method';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
$callback = ['', ''];
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
$callback = '::';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
$callback = 'Class:';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
$callback = ':method';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
$callback = ':';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
string(0) ""
string(0) ""
Class '' not found
Class '' not found
Class '' not found
Class '' not found
Call to undefined function Class:()
Call to undefined function :method()
Call to undefined function :()