Questions about PHP classes and objects

Source: Internet
Author: User
Problems with PHP classes and objects

Excuse me, why not
Public $mp =new Model ("ProductType");
Well, I can do that in C #, but it's a property of the object. PHP is the wrong package, why AH. PHP Object class

Share to:


------Solution--------------------
That is, the value type should be: Basic data type, can be an array, object not
------Solution--------------------
C # is compiled and executed, so you can use
PHP is interpreted, and it is impossible to predict what the new Model ("ProductType") is in the parsing phase.

In fact, C # in the parsing phase is also not aware of the new Model ("ProductType") is something
But he also has a binder process that can handle it
PHP does not have this linking process, but after parsing it, it executes, and the side performs the edge interpretation.

  • Related Article

    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.