summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70685.phpt
blob: e286e58e7d375899e99a144cc6db9fc85a75d047 (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 internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
NULL

Warning: Cannot bind function SplDoublyLinkedList::count to scope class cls in %s on line %d
NULL