php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /proc/self/root/var/www/html/sub/images/Rm19_symconf/root/opt/php-7.0.1/Zend/tests/ |
| files >> //proc/self/root/var/www/html/sub/images/Rm19_symconf/root/opt/php-7.0.1/Zend/tests/bug68475.phpt |
--TEST--
Bug #68475 Calling function using $callable() syntax with strings of form 'Class::method'
--FILE--
<?php
class TestClass
{
public static function staticMethod()
{
echo "Static method called!\n";
}
public static function staticMethodWithArgs($arg1, $arg2, $arg3)
{
printf("Static method called with args: %s, %s, %s\n", $arg1, $arg2, $arg3);
}
}
// Test basic call using Class::method syntax.
$callback = 'TestClass::staticMethod';
$callback();
// Case should not matter.
$callback = 'testclass::staticmethod';
$callback();
$args = ['arg1', 'arg2', 'arg3'];
$callback = 'TestClass::staticMethodWithArgs';
// Test call with args.
$callback($args[0], $args[1], $args[2]);
// Test call with splat operator.
$callback(...$args);
// Reference undefined method.
$callback = 'TestClass::undefinedMethod';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
// Reference undefined class.
$callback = 'UndefinedClass::testMethod';
try {
$callback();
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Static method called!
Static method called!
Static method called with args: arg1, arg2, arg3
Static method called with args: arg1, arg2, arg3
Call to undefined method TestClass::undefinedMethod()
Class 'UndefinedClass' not found
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`