Open YuanchengJiang opened 1 day ago
Smaller reproducible:
$obj = new SplFileObject(__FILE__);
$class = 'SensitiveParameterValue';
foreach (get_class_methods($class) as $method) {
echo "Method: $method\n";
try {
$obj->$method();
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
The issue seems to possibly be with get_class_methods()
as if I set $method = '__debugInfo'
explicitly it, it works.
Okay I figured out the issue:
$obj = new SplFileObject(__FILE__);
try {
$obj->__construct();
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$obj->__debugInfo();
The constructor when it fails sets intern->u.file.open_mode = NULL;
which causes the null deref afterwards.
Description
The following code:
Resulted in this output:
PHP Version
nightly
Operating System
ubuntu 22.04