mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
ab98944195
Fixes oss-fuzz #30317.
31 lines
576 B
PHP
31 lines
576 B
PHP
--TEST--
|
|
Dynamic static call of non-static method
|
|
--FILE--
|
|
<?php
|
|
class Foo {
|
|
function test1() {
|
|
$method = ['Foo', 'bar'];
|
|
$method();
|
|
}
|
|
function test2() {
|
|
$method = 'Foo::bar';
|
|
$method();
|
|
}
|
|
function __call($name, $args) {}
|
|
}
|
|
$x = new Foo;
|
|
try {
|
|
$x->test1();
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$x->test2();
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Non-static method Foo::bar() cannot be called statically
|
|
Non-static method Foo::bar() cannot be called statically
|