Discover call function in php class, include the articles, news, trends, analysis and practical advice about call function in php class on alibabacloud.com
Q: How can a subclass object directly call a function that is overloaded in the base class? /// Check the following code for the problem:
Class
{
Function ()
{
$ This-> nnum= 1024;
}
Function SelfClass ()
{
Echo "class
";
}
}
Class B
Packaging | design | Project coding is not a difficult task for qualified PHP programmers (perhaps just a matter of time), so the system analysis and design phase becomes particularly important. However, this article does not intend to discuss and
I. Structure and call (instantiation): classclassName {}, call: $ obj = newclassName (); when a class has a constructor, you should also input parameters. For example, $ obj = newclassName ($ v, $ v2 & hellip;); 2: constructor and Destructor: 1.
1. Structure and call (instantiation ):
Class className {}, call: $ obj = new className (); when the class has a constructor, you should also input parameters. For example, $ obj = new className ($ v, $ v2 ...);
2. constructor and destructor:1.
: This article mainly introduces php programming notes. if you are interested in PHP tutorials, please refer to them. Three methods for php to obtain POST data
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese
Php programming notes-three methods for obtaining POST data from small_123 php
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese character to pinyin source code
Php traverses the Directory, generates the md5
Three ways to get post data from PHP
PHP image plus watermark source code
One of the simplest examples of Php+ajax+json
PHP Chinese Pinyin Source code
PHP iterates through directories, generates MD5 values for each file in the directory, and writes
One: Structure and invocation (instantiation):
Class classname{}, calling: $obj = new ClassName (), and when the class has a constructor, it should also pass in the argument. such as $obj = new ClassName ($v, $v 2 ...);
Two: Constructors and
PHP, a nested abbreviated name, is an abbreviation for the English Super Text preprocessing language (Php:hypertext preprocessor). PHP is an HTML embedded language, PHP and Microsoft's ASP quite a bit similar, is a server-side implementation of
The question looks like the following code
Class A
{
function A ()
{
$this->nnum = 1024;
}
function Selfclass ()
{
echo "Class A
";
}
}
Class B extends A
{
function Selfclass ()
{
echo "Class B
";
}
}
?>
$obj = new B ();
$obj->selfclass ();
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.