/** * Returns whether this function has been disabled or not * * @return boolean True if this function has been disabled */ public function isDisabled() { if ($this->reflectionSource instanceof ReflectionFunction) { return $this->reflectionSource->isDisabled(); } else { return parent::isDisabled(); } }
/** * Highlighter with built-in check for list of disabled function (Google AppEngine) * * @param string $file Name of the file */ public static function highlight($file) { $highlightFileFunc = new \ReflectionFunction('highlight_file'); if (!$highlightFileFunc->isDisabled()) { highlight_file($file); } else { echo '<pre>' . htmlspecialchars(file_get_contents($file)) . '</pre>'; } }
<?php $rc = new ReflectionFunction('is_file'); var_dump($rc->isDisabled());
<?php $rf = new ReflectionFunction('is_file'); var_dump($rf->isDisabled()); var_dump(method_exists('ReflectionFunction', 'isDisabled')); var_dump(method_exists('ReflectionMethod', 'isDisabled'));