mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
e19423f3cb
Don't forbid null binding on plain functions.
17 lines
388 B
PHP
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)
|