Do I not add a new line when the object is instantiated?

Source: Internet
Author: User
When the object is instantiated, do you not add a new line? someone writes $ _ sxe = simplexml_load_file ('Text. XML') like this ');
Is it a function or an object?


Reply to discussion (solution)

Simplexml_load_file is a function.
Returns a SimpleXMLElement object.

You bought a car at the 4S store, and you don't need to build it again.

Simplexml_load_file is a function.
Returns a SimpleXMLElement object.

You bought a car at the 4S store, and you don't need to build it again.



As you said, can all php built-in objects be declared without directly using the functions in the object as the instantiation method?

How can this problem be understood? You should take a good look at the manual

If you are ill, don't answer it. get out of the box. do you still need to mention it if your mom B doesn't read the manual? why don't you disagree! Fuck!

How can this problem be understood? You should take a good look at the manual

Your mom B, are you having no problems with php now? if you have any problems, read the manual. are you still confused?

$ _ Sxe = simplexml_load_file ('Text. XML ');

Assign the SimpleXMLElement object returned by simplexml_load_file to the $ _ sxe variable.

Reading the manual is required. There are many problems that may not be available online. you can only read the manual. if you do not have a manual, you can even view the source code.

In this case, the return value of this function is an instantiated object, just like the Singleton mode. you don't need new, but you operate on objects.

Simplexml_load_file is a function.
The data returned by simplexml_load_file is an object.
There is no conflict between the two.

For example, foo is a method and an object is returned.

function foo(){    $ret = array(        'name' => 'fdipzone'    );    return (object)$ret;}$obj = foo();echo $obj->name; // fdipzone

Simplexml_load_file is a function.
The data returned by simplexml_load_file is an object.
There is no conflict between the two.

For example, foo is a method and an object is returned.

function foo(){    $ret = array(        'name' => 'fdipzone'    );    return (object)$ret;}$obj = foo();echo $obj->name; // fdipzone


I think you are right about this. remember that this principle is used in javascript to enable the write function.

I wonder why it's always a little silly. it's okay. Is it fun here? Your mom B, you don't like to answer other people's questions, or you are very disgusted with the questions raised by others. you can leave here, and this is not a zombie, it's not a cinema either. it's really hard for your mom B to understand. why are you suffering from this sin? there's only one explanation!

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.