summaryrefslogtreecommitdiff
path: root/Zend/tests/bug61025.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug61025.phpt')
-rw-r--r--Zend/tests/bug61025.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/Zend/tests/bug61025.phpt b/Zend/tests/bug61025.phpt
new file mode 100644
index 000000000..0709c28fb
--- /dev/null
+++ b/Zend/tests/bug61025.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #61025 (__invoke() visibility not honored)
+--FILE--
+<?php
+
+Interface InvokeAble {
+ static function __invoke();
+}
+
+class Bar {
+ private function __invoke() {
+ return __CLASS__;
+ }
+}
+
+$b = new Bar;
+echo $b();
+
+echo $b->__invoke();
+
+?>
+--EXPECTF--
+Warning: The magic method __invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
+
+Warning: The magic method __invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
+Bar
+Fatal error: Call to private method Bar::__invoke() from context '' in %sbug61025.php on line %d