Ask a question.

Source: Internet
Author: User
Tags unsupported
Ask a question.
 Name ."
"; Echo" My age is: ". $ this-> age ;}}

 sum($a,$b);            return $this->prt($a,$c);        }    }    $c=new cal();    echo "(2+3)*10= " .$c->result('2','3','10');?>


Can you give me a detailed answer? I don't quite understand. Can I use var mixed in the brackets of $ this-> prt? Not quite familiar with->!


Reply to discussion (solution)

Can you give me a detailed answer!

$ This object itself

For example, you
$ C = new cal (); // instantiate class cal, then $ c is the object
Echo "(2 + 3) * 10 = ". $ c-> result ('2', '3', '10'); // you can access the $ c object in this way.

In $ c, how do you access it?
The answer is $ this.

$ This-> prt () should not be placed ..
An error is reported when $ a * $ c is executed ..
Unsupported operand types
It means that Arrays and numbers cannot be multiplied.
$ This indicates the instantiated object itself.
This object includes the prt () method.
$ This-> prt () indicates executing the prt () contained in this object ()
-> Select and execute.

$ This-> prt () should not be placed ..
An error is reported when $ a * $ c is executed ..
Unsupported operand types
It means that Arrays and numbers cannot be multiplied.
$ This indicates the instantiated object itself.
This object includes the prt () method.
$ This-> prt () indicates executing the prt () contained in this object ()
-> Select and execute.
It seems to be okay. no error is reported.

$ This object itself

For example, you
$ C = new cal (); // instantiate class cal, then $ c is the object
Echo "(2 + 3) * 10 = ". $ c-> result ('2', '3', '10'); // you can access the $ c object in this way.

In $ c, how do you access it?
The answer is $ this.
Thks

Yes?
Can you execute this code? I reported an error.
If you can run it, please tell me the result.

 sum($a,$b);            return $this->prt($a,$c);        }    }    $c=new cal();    echo "(2+3)*10= " .$c->result($a,'3','10');?>

Yes?
Can you execute this code? I reported an error.
If you can run it, please tell me the result.

 sum($a,$b);            return $this->prt($a,$c);        }    }    $c=new cal();    echo "(2+3)*10= " .$c->result($a,'3','10');?>

This code cannot run,
 sum($a,$b);            return $this->prt($a,$c);        }    }    $c=new cal();    echo "(2+3)*10= " .$c->result('2','3','10');?>
This code can run this section of my post

Of course you can run it.
Var mixed in my mind
Int integer
Longint long integer
Real number type
Char character type
String
Array
I don't know if I have misunderstood what LZ meant.

Of course you can run it.
Var mixed in my mind
Int integer
Longint long integer
Real number type
Char character type
String
Array
I don't know if I have misunderstood what LZ meant.
Oh no. I got it wrong. thank you for answering thanks!

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.