The role of the Var manifesto in PHP

Source: Internet
Author: User
What is the function of the Var declaration in PHP?
Recently learned PHP, but even though the PHP Bible involves a wide range of teaching materials also did not mention that PHP can declare variables with VAR, but look at a book on the network, the use of Var to declare the Ming. Such as:

Class test{
var $a;
var $b;
......
}


I tested it as if Var could only be used in the class, and would be an error if used outside of the class (PHP5.3).

What can be summed up at this point, which is the potential system to talk about the other role of this keyword?

------Solution--------------------
Public in PHP5 is equivalent to Var.
Just to be compatible with PHP4, so also keep Var
------Solution--------------------
Forward compatibility
  • 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.