Ask a question.

Source: Internet
Author: User
Tags unsupported
 
  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!

  • 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.