php-src/Zend/tests/bug70681.phpt
Nikita Popov e19423f3cb Improve previous fix
Don't forbid null binding on plain functions.
2015-10-09 23:28:24 +02:00

17 lines
388 B
PHP

--TEST--
Bug #70681: Segfault when binding $this of internal instance method to null
--FILE--
<?php
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(null);
$c = (new ReflectionFunction('strlen'))->getClosure();
$c = $c->bindTo(null);
var_dump($c("foo"));
?>
--EXPECTF--
Warning: Cannot unbind $this of internal method in %s on line %d
int(3)