CodeIgniter 在 PHP 5.3 时区报错

"warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier." 

ci根目录下的index.php文件中加如下代码即可
/*
|---------------------------------------------------------------
| DEFAULT TIMEZONE
|---------------------------------------------------------------
|
| Set the default timezone for date/time functions to use if
| none is set on the server.
|
*/

if( ! ini_get('date.timezone') )
{
   date_default_timezone_set('GMT');
}

php 返回所有已经定义的函数 get_defined_functions

get_defined_functions
该函数返回所有已经定义的函数,包括内置函数和用户自定义函数
<?php
function addition ($a, $b){
      echo ($a + $b), "\n";
  }

print_r(get_defined_functions());
/*
Array
(
    [internal] => Array
        (
            [0] => zend_version
            [1] => func_num_args
            [2] => func_get_arg
            [3] => func_get_args
            [4] => strlen
            [5] => strcmp
            [6] => strncmp
            [7] => strcasecmp
            [8] => strncasecmp
            [9] => each
            [10] => error_reporting
            …………
        )

    [user] => Array
        (
            [0] => addition
        )

)

*/
?>
internal 是系统内置方法
user 是用户自定义方法

PHP动态调用函数

<?php
 //定义一个方法
  function addition ($a, $b){
      echo ($a + $b), "\n";
  }
  //定义一个变量设置方法名为变量
  $result = "addition";
  //变量作为方法使用
  $result (3,6);

?>