小编Rya*_*n_K的帖子

PHP Late Static Binding - 解析错误:语法错误,意外T_STRING,期待T_VARIABLE

测试一些后期静态绑定并在第5行获取此错误:

Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE

第5行:

protected static test = 'A TEST';

这是来源:

class A {

    protected static test = 'A TEST';

    public static function test() {
        echo $this->test;
    }
}

Class B extends A {
    public static test = "B TEST";
    public function static_test() {
        echo static::$test;
    }
}

$a = new A;
$b = new B;

echo '$a->test()<br />';
echo $a->test();
echo '<br /> <br />';
echo '$b->test()<br />';
echo $b->test();
echo '<br /> …
Run Code Online (Sandbox Code Playgroud)

php static late-binding

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

CSS没有链接到xHTML

虽然我多次访问过这个网站,但这是我的第一个问题.

经过几个小时的google-foo无济于事,我无法将我的样式表链接起来.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en” xml:lang=”en”>
<head>

    <title>Newb Development</title>

    <link type=“text/css” rel="stylesheet" href=”\master.css” />

</head>

<body>

    <img src="banner.gif" alt="NewbDev Logo" title="Newb Development" />
    <h1>Welcome To NewbDev.com</h1>

    <h2>Under Construction</h2>
    <p>
    As you can see, we are currently under construction.  Upon completion
    of the website you will be able to follow a fellow newb developer
    on his journey to <em>programming masterification!</em>
    </p>

</body>
Run Code Online (Sandbox Code Playgroud)

文件"master.css"位于同一目录中.我已经在计算机和服务器上尝试过它,我的样式不适用.我知道我没有在这里发布的样式表,但它没什么特别的,我很肯定样式表的内容不是问题.

css xhtml linker

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

标签 统计

css ×1

late-binding ×1

linker ×1

php ×1

static ×1

xhtml ×1