mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
f3e5bbe6f3
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2 Co-authored-by: Levi Morrison <levim@php.net> Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
15 lines
233 B
PHP
15 lines
233 B
PHP
--TEST--
|
|
Cannot use $this as lexical variable
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
public function f() {
|
|
return function() use ($this) {};
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use $this as lexical variable in %s on line %d
|