mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
77bb96d7c9
Also improve the error message for $this used in parameters.
17 lines
287 B
PHP
17 lines
287 B
PHP
--TEST--
|
|
Bug #71737: Memory leak in closure with parameter named $this
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
public function method() {
|
|
return function($this) {};
|
|
}
|
|
}
|
|
|
|
(new Test)->method()(new stdClass);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use $this as parameter in %s on line %d
|