Stdclass in PhP5

Source: Internet
Author: User

Introduction: This is a detailed page of stdclass in PhP5. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 338278 'rolling = 'no'>

Stdclass added in PhP5

Official reference: http://www.php.net/manual/en/language.oop5.basic.php#92123

The stdclass class is an internal reserved class of PHP. It has no member variables or member methods at the beginning, and all magic methods are set to null. You can use it to pass variable parameters, however, there are no methods that can be called. The stdclass class can be inherited, but it makes no sense to do so.

This class is a reserved PHP class, not the base class of all classes.

 
<? Phpclass Foo {}$ bar = new Foo (); echo $ bar instanceof stdclass? 'Yes': 'no'; // output: No

Another example:

 
<? PHP // ctest does not derive from stdclassclass ctest {public $ property1;} $ T = new ctest; var_dump ($ t instanceof stdclass); // falsevar_dump (is_subclass_of ($ t, 'stdclass'); // falseecho get_class ($ T ). "\ n"; // 'ctest' echo get_parent_class ($ T ). "\ n"; // false (no parent)?>

Any forced conversion with (object) will get an instance of stdclass.

Refer:

Http://www.phppan.com/2011/05/php-stdclass/

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/338278.html pageno: 9.

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.