summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_041.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-10-10 13:39:26 +0200
committerNikita Popov <nikic@php.net>2015-10-10 13:56:36 +0200
commit4b821f0fc6aade0eb9793a8b4fa3cd28b347ac2f (patch)
tree2f9b9e629f0fdd16c28c136d29386238e4ecfd23 /Zend/tests/closure_041.phpt
parentffb5d0aca30f4730940b6f3265a2f634259ef5b0 (diff)
downloadphp-git-4b821f0fc6aade0eb9793a8b4fa3cd28b347ac2f.tar.gz
Normalize rebinding failures
Move all rebinding checks into one function to make sure they stay in sync. Normalize return value to be NULL for all rebinding failures, instead of returning an improperly bound closure in some cases.
Diffstat (limited to 'Zend/tests/closure_041.phpt')
-rw-r--r--Zend/tests/closure_041.phpt8
1 files changed, 2 insertions, 6 deletions
diff --git a/Zend/tests/closure_041.phpt b/Zend/tests/closure_041.phpt
index 947517b4ed..a7e9eab482 100644
--- a/Zend/tests/closure_041.phpt
+++ b/Zend/tests/closure_041.phpt
@@ -53,9 +53,9 @@ $d = $nonstaticScoped->bindTo(null); $d(); echo "\n";
$d->bindTo($d);
echo "After binding, with same-class instance for the bound ones", "\n";
-$d = $staticUnscoped->bindTo(new A); $d(); echo "\n";
+$d = $staticUnscoped->bindTo(new A);
$d = $nonstaticUnscoped->bindTo(new A); $d(); echo " (should be scoped to dummy class)\n";
-$d = $staticScoped->bindTo(new A); $d(); echo "\n";
+$d = $staticScoped->bindTo(new A);
$d = $nonstaticScoped->bindTo(new A); $d(); echo "\n";
echo "After binding, with different instance for the bound ones", "\n";
@@ -87,14 +87,10 @@ After binding, with same-class instance for the bound ones
Warning: Cannot bind an instance to a static closure in %s on line %d
scoped to A: bool(false)
-bound: no
-scoped to A: bool(false)
bound: A (should be scoped to dummy class)
Warning: Cannot bind an instance to a static closure in %s on line %d
scoped to A: bool(true)
-bound: no
-scoped to A: bool(true)
bound: A
After binding, with different instance for the bound ones
scoped to A: bool(false)