小编al-*_*-dr的帖子

php - 这些功能是否可以减少服务器负载?

晚上好,
我有这些five functions用于reduce server load:

// unset all vars
function unset_all_vars()
{
    $vars = func_get_args();
    foreach($vars[0] as $key => $val)
    {
        unset($GLOBALS[$key]);
    }
    return serialize($vars[0]);
} 
unset_all_vars(get_defined_vars()); 

// unset all const
function unset_all_const()
{
    $vars =  func_get_args();
    foreach($vars[0] as $key => $val)
    {
        unset($key);
    }
    return serialize($vars[0]);
} 
unset_all_const(get_defined_constants()); 

// unset all functions
function unset_all_functions()
{
    $vars =  func_get_args();
    foreach($vars[0] as $key => $val)
    {
        unset($key);
    }
    return serialize($vars[0]);
} 
unset_all_functions(get_defined_functions()); 

// unset all classes
function …
Run Code Online (Sandbox Code Playgroud)

php reduce load

0
推荐指数
1
解决办法
202
查看次数

标签 统计

load ×1

php ×1

reduce ×1