[php-src] Issue #22866: Allow Disabling Class Methods via disable_methods in php.ini
[email protected] (chopins) Thu, 23 Jul 2026 03:12:36 +0000
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/22866
Author: chopins
### Description
Whether it is necessary to have a php.ini configuration directive to disable class methods, similar to the `disable_functions` and `disable_classes` directives, by adding a new `disable_methods=ClassName1::MethodName,ClassName2::MethodName2`?
The following is an example of disabling a class method (`ReflectionMethod::getStaticVariables()`) via the FFI extension:
```php
$mtptr = \FFI::addr($ffi->reflection_method_ptr->function_table);
$ffi->zend_hash_str_del($mtptr, "getstaticvariables", strlen('getstaticvariables'));
```