summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_045.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/closure_045.phpt')
-rw-r--r--Zend/tests/closure_045.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Zend/tests/closure_045.phpt b/Zend/tests/closure_045.phpt
new file mode 100644
index 0000000..4115691
--- /dev/null
+++ b/Zend/tests/closure_045.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Closure 045: Closures created in static methods are static, even without the keyword
+--FILE--
+<?php
+
+class A {
+static function foo() {
+ return function () {};
+}
+}
+
+$a = A::foo();
+$a->bindTo(new A);
+
+echo "Done.\n";
+
+--EXPECTF--
+Warning: Cannot bind an instance to a static closure in %s on line %d
+Done.