php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66729 Introduce a means to test if a function has been disabled via disable_functions
Submitted: 2014-02-17 21:23 UTC Modified: 2014-02-17 23:58 UTC
From: johnbillion+php at gmail dot com Assigned:
Status: Wont fix Package: *Configuration Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-02-17 21:23 UTC] johnbillion+php at gmail dot com
Description:
------------
Feature request.

It is possible to disable PHP functions via the `disable_functions` directive in php.ini. However, there is no method of testing, at runtime, whether a given function has been disabled by this means,

The common way to detect whether a function has been disabled is to inspect the return value of `ini_get('disable_functions')`. This is far from optimal, especially if `ini_get()` itself has been disabled.

A function should be introduced which accepts a function name and returns a boolean value stating whether the function has been disabled. Example:

`if ( ! function_disabled('exec') ) { exec( $command ) }`

Alternatively, to avoid the double negative, it could be named something like `function_enabled()` or `function_available()`.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-17 23:58 UTC] requinix@php.net
-Status: Open +Status: Wont fix
 [2014-02-17 23:58 UTC] requinix@php.net
function_exists() does that.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 10:01:26 2019 UTC