php-src/Zend/tests/bug71737.phpt
Nikita Popov 77bb96d7c9 Fix bug #71737
Also improve the error message for $this used in parameters.
2016-04-20 18:38:40 +02:00

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