php-src/Zend/tests/bug70685.phpt
Nikita Popov d7d01fc9a3 Fixed bug #70685
Doing a less intrusive variant of the PHP 7.0 fix for 5.6.
2015-10-10 14:59:21 +02:00

23 lines
590 B
PHP

--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