PHP two methods in the same class can call each other?

Source: Internet
Author: User
Solve it, 、、、、、、、、、、、.


Reply to discussion (solution)

Of course it's possible.

Don't die in the loop.

Of course it's possible.

How did it fall? When I call today, I'm calling to undefined function 、、、

Paste the code, you tune the way there are problems

Paste the code, you tune the way there are problems

Public Function Execute_dql_fenye ($sql 1, $sql 2, $fenyePage) {}public function abc () {Execute_dql_fenye (& $sql 1, & $sql 2,& $fenyePage);}

Public Function Execute_dql_fenye ($sql 1, $sql 2, $fenyePage) {

}
Public Function abc () {
$this->execute_dql_fenye (& $sql 1,& $sql 2,& $fenyePage);
}

Public Function Execute_dql_fenye ($sql 1, $sql 2, $fenyePage) {

}
Public Function abc () {
$this->execute_dql_fenye (& $sql 1,& $sql 2,& $fenyePage);
}


Yes, well, 、、、 I said it didn't work out. The contents of my method are wrong 、、、 Thank you, great God 、、、

A positive solution ... The same is true for variables

For example, methods A and B belong to a Class C, and a calls B:

Class c{
function B () {
return 1;
}
function A () {
$result =self::b ();
}
}

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.