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 explain it in detail? Not quite understand $this->prt () can be var mixed in parentheses?
Reply to discussion (solution)
Can you answer it in detail!
$this objects themselves
Like you.
$c =new cal (); Instantiate the Class Cal, when $c is the object
echo "(2+3) *10=". $c->result (' 2 ', ' 3 ', ' 10 '); You can access this object in this way $c
So how do you access the inside of the $c?
The answer is to use $this
$this->prt () should not be put inside.
You will get an error when executing to the $a* $c.
Unsupported operand types
It means that arrays and numbers cannot be multiplied.
The $this represents the instantiated object itself.
This object includes the PRT () method.
$this->prt () means that the execution of this object itself contains the PRT ()
General is the meaning of selection and execution.
$this->prt () should not be put inside.
You will get an error when executing to the $a* $c.
Unsupported operand types
It means that arrays and numbers cannot be multiplied.
The $this represents the instantiated object itself.
This object includes the PRT () method.
$this->prt () means that the execution of this object itself contains the PRT ()
General is the meaning of selection and execution.
Seems to be able to put, no error
$this objects themselves
Like you.
$c =new cal (); Instantiate the Class Cal, when $c is the object
echo "(2+3) *10=". $c->result (' 2 ', ' 3 ', ' 10 '); You can access this object in this way $c
So how do you access the inside of the $c?
The answer is to use $this
Popular Understanding THKS
Is it?
Can you execute this code? I have an error.
Can run the trouble to tell me the result.
SUM ($a, $b); return $this->prt ($a, $c); } } $c =new cal (); echo "(2+3) *10=". $c->result ($a, ' 3 ', ' 10 ');? >
Is it?
Can you execute this code? I have an error.
Can run the trouble to 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 does not work, but
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 it can run.
var mixed in my heart
int integral type
Longint Long Integral type
Real Real type
char character type
String strings
Array arrays
I don't know if I misunderstood the LZ's meaning.
Of course it can run.
var mixed in my heart
int integral type
Longint Long Integral type
Real Real type
char character type
String strings
Array arrays
I don't know if I misunderstood the LZ's meaning.
Oh, no, I understand. Thank you for your answer thanks!