Php subclass how to access the static method of the parent class-php Tutorial
Source: Internet
Author: User
Php subclass how to access the static method of the parent class 1. the subclass accesses the static member attributes or methods of the parent class, using parent: method ()/self: method ()
Note: $ this-> staticProperty (the static property of the parent class cannot be accessed through $ this (subclass instance). the following error occurs: PHP Strict Standards: Accessing static property Person :: $ country as non static in, PHP Notice: Undefined property :)
2. subclass external
1. subclass name: method ()
2. subclass instance-> method () (static methods can also be accessed through common objects)
Note: subclass instance-> staticProperty (the static property of the parent class cannot be accessed through the subclass instance. the following error occurs: PHP Strict Standards: Accessing static property Person :: $ country as non static in, PHP Notice: Undefined property :)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.