php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44966 Cannot create ReflectionFunction object for disabled functions
Submitted: 2008-05-11 05:10 UTC Modified: 2008-05-11 08:45 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sebastian@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-05-11 (CVS) OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sebastian@php.net
New email:
PHP Version: OS:

 

 [2008-05-11 05:10 UTC] sebastian@php.net
Description:
------------
One cannot create an object of the ReflectionFunction class for a function that has been disabled via the disable_functions configuration directive.

This effectively renders the ReflectionFunction::isDisabled() method useless.

Reproduce code:
---------------
--TEST--
ReflectionFunction::isDisabled()
--INI--
disable_functions=eval
--FILE--
<?php
$function = new ReflectionFunction('sort');
var_dump($function->isDisabled());

$function = new ReflectionFunction('eval');
var_dump($function->isDisabled());
?>
--EXPECT--
bool(false)
bool(true)


Expected result:
----------------
Test passes.

Actual result:
--------------
bool(false)

Fatal error: Uncaught exception 'ReflectionException' with message 'Function eval() does not exist' in /home/sb/ReflectionFunction_isDisabled.php:5
Stack trace:
#0 /home/sb/ReflectionFunction_isDisabled.php(5): ReflectionFunction->__construct('eval')
#1 {main}
  thrown in /home/sb/ReflectionFunction_isDisabled.php on line 5

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-11 08:31 UTC] zeeky dot h at gmail dot com
eval is not a function. Therefore it cannot be disabled or reflected.
 [2008-05-11 08:45 UTC] sebastian@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 04:01:33 2025 UTC