小编mzi*_*mer的帖子

(字符串)'硬拷贝'字符串?

PHP使用修改后复制系统.

请问$a = (string) $a;($ a是已经串)修改和复制任何东西?


特别是,这是我的问题:

参数1是mixed/我想允许传递非字符串并将它们转换为字符串.
但有时这些字符串非常大.所以我想省略复制param,这已经是一个字符串了.

我可以使用版本Foo还是必须使用版本Bar

class Foo {
    private $_foo;
    public function __construct($foo) {
        $this->_foo = (string) $foo;
    }
}

class Bar {
    private $_bar;
    public function __construct($bar) {
        if (is_string($bar)) {
            $this->_bar = $bar;
        } else {
            $this->_bar = (string) $bar;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

php string copy-on-write

27
推荐指数
3
解决办法
8506
查看次数

php5与mod_fcgid导致500错误 - 可能是错误的权限

每次我请求.php文件时,我都会收到500错误代码.

我尝试了许多不同的文件权限并搜索了整个互联网(或者至少,感觉就像这样),但我找不到任何有用的东西.(这不是一个容易找到suexec错误或类似的东西.但我想,这是权限的东西......可能我只是不知道/某一点......)

/var/log/apache2/error.log(LogLevel info)

[Tue Sep 11 12:47:21 2012] [info] Init: Seeding PRNG with 648 bytes of entropy
[Tue Sep 11 12:47:21 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Tue Sep 11 12:47:21 2012] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Tue Sep 11 12:47:21 2012] [info] Init: Initializing (virtual) servers for SSL
[Tue Sep 11 12:47:21 2012] [info] mod_ssl/2.2.16 compiled against Server: Apache/2.2.16, Library: OpenSSL/0.9.8o
[Tue Sep 11 12:47:21 2012] [notice] suEXEC mechanism enabled (wrapper: …
Run Code Online (Sandbox Code Playgroud)

php permissions fastcgi mod-fcgid

8
推荐指数
1
解决办法
9634
查看次数

标签 统计

php ×2

copy-on-write ×1

fastcgi ×1

mod-fcgid ×1

permissions ×1

string ×1