コード例 #1
0
 /**
  * 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();
     }
 }
コード例 #2
0
 /**
  * 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>';
     }
 }
コード例 #3
0
<?php

$rc = new ReflectionFunction('is_file');
var_dump($rc->isDisabled());
コード例 #4
0
<?php

$rf = new ReflectionFunction('is_file');
var_dump($rf->isDisabled());
var_dump(method_exists('ReflectionFunction', 'isDisabled'));
var_dump(method_exists('ReflectionMethod', 'isDisabled'));