阅读背景:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

来源:互联网 
<?php
class Car
{
    var $color = "add";
    function Car($color="green") {
        $this->color = $color;
    }
    function what_color() {
        return $this->color;
    }
}

$car = new Car;
echo $car->what_color(),"<br>over";
?><?php
class Car
{
    var $color = "add";
 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: