mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
24 lines
440 B
PHP
24 lines
440 B
PHP
--TEST--
|
|
Bug #77877 call_user_func() passes $this to static methods
|
|
--FILE--
|
|
<?php
|
|
class Foo {
|
|
static public function bar() {
|
|
var_dump($this);
|
|
}
|
|
}
|
|
try {
|
|
array_map([new Foo, 'bar'],[1]);
|
|
} catch (Throwable $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
try {
|
|
call_user_func([new Foo, 'bar']);
|
|
} catch (Throwable $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Using $this when not in object context
|
|
Using $this when not in object context
|