summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70685.phpt
blob: 737b4469fdbe483015fe72d51cc271f68fabfba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Bug #70685: Segfault for getClosure() internal method rebind with invalid $this
--FILE--
<?php

class cls {}

$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(new cls);
var_dump($c);

$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(new SplStack, 'cls');
var_dump($c);

?>
--EXPECTF--
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
NULL

Warning: Cannot rebind scope of closure created from method in %s on line %d
NULL