php syntax is very similar to c++;
A simple object-oriented code:
object-oriented object-oriented code Public $CatAge ;
; ->CatName = $name;
$color;
"n" represents a space
return "{$this->CatName}n"."{$this->CatColor}n"."{$this->CatAge}"; = new Cat("lex","black","3");
//If you assign a value to an attribute that the object does not have, php will not report an error;
$SmallCat ->Wrong = "error;
print "{$SmallCat->ShowCat()}";
?>
print is used to output all items; there is no difference between "" and '' in
php; methods in
php are public by default Type; the attribute defaults to private type
If it meets the grammatical specifications in php, it will not report an error, so checking errors in php is a very troublesome thing;