Regarding the issue of whether subclasses will automatically call the parent class constructor
帝释天
帝释天 2019-04-24 22:19:10
0
0
938

<?php

header("content-type:text/html;charset=utf-8");

class nn//This code is obvious. The class automatically calls the constructor of the parent class. . . .

{

public $name;

public function __construct()

{

echo 'I am in the nn class Constructor! <br>';

//$this->name=$iname;

}


}

class mm extends nn

{


}

$p=new mm;

?> ;


帝释天
帝释天

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!