A question in the php Manual

Source: Internet
Author: User
A question in the php Manual is used:
Is this a static method?
Or does it only indicate that this method exists in this class?


Reply to discussion (solution)

Indicates that this method is available.
Most of them cannot be used without instantiation.

Indicates that this method exists in the class. whether it is a static method depends on the document. most of them are not.

$ Memcache_obj = memcache_connect ("localhost", 11211);/* process-oriented programming API */memcache_add ($ memcache_obj, 'Var _ key', 'Test variable', false, 30);/* object-oriented programming API */$ memcache_obj-> add ('Var _ key', 'Test variable', false, 30 );

Thank you. Another question is: is self and _ CLASS _ in the CLASS different?

_ CLASS _ only the CLASS name is a string
Self is a class reference.

@ AO xuexingfeng: Is $ a used here? If yes, the variable is not assigned a value. why not report an error?

A variable is defined, but no value is assigned. Not an error.

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.