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!