Recently done a project is based on PHP4, accustomed to PHP5 face object, face PHP4, inevitably will have a lot of uncomfortable:
Does not support the public, static, private, protected keywords, the most depressing is that the destructor is not
The detailed code is as follows:
data[$key]; } Public function set ($key, $value) { $this->data[$key] = $value; }} Abstract class Controller { protected $registry; Public function construct ($registry) {
unknowingly found that PHP has been out of the 5.5 version, and I have been using PHP5.2, let me look like a mountain out of the young man, and land and backward. In my habit inJavascript
in the use of closures, suddenly the PHP closure to play an
This article mainly introduces the PHP anonymous function introduced by php5.3, that is, the closure (Closure), and the role of closures, very detailed, recommended to the needs of small partners.
PHP's Closure (Closure) is an anonymous function,
One, the difference between the public,private,protected
Public: Permissions are maximum, can be called internally, instance calls, and so on.Protected: Protected type, used for this class and for inheriting class calls.Private: Proprietary type,
This article mainly introduces the reflection reflection mechanism test example in PHP, from this article can learn some reflection of the use of methods, the need for friends can refer to the following
Java class reflection is applied very broadly
difference:
1, the use of the interface is through the keyword implements. The use of abstract classes is through the keyword extends. Of course the interface can also be inherited by the keyword extends.
2. You cannot declare member variables
This article mainly introduces the PHP interface technology, combined with an example of the basic concept of PHP interface, function, definition, use methods and related considerations, the need for friends can refer to the following
1. Interface
1.php Interface class: Interface
In fact, their role is very simple, when a lot of people to develop a project, it may be to call someone else to write some of the classes, then you will ask, how do I know how the implementation of one of his
Speaking of the reflection API, I feel that the reflection API in PHP is similar to the Java.lang.reflect package in Java, which consists of a set of built-in classes that can print and parse class member properties and methods. You may have learned
This article mainly introduced the Symfony query method, combined with the example form summarizes and analyzes the CreateQuery and getquery query data specific use skills, needs friends can refer to the next
This article describes the Symfony
This article mainly introduces the PHP closure and example code of the relevant information, the need for friends can refer to the following
Closures and anonymous functions are introduced in the PHP5.3.0.
Closures are functions that encapsulate
This article mainly introduces the PHP implementation of the simulation landing, access to the user list and the bulk of the message function, combined with specific examples of the PHP interface to analyze the relevant calls and operation skills,
Use just uses a namespace,
But to invoke the class, you have to load the class file, or load it automatically.
Even if one of the classes is introduced, if there is no automatic loading mechanism, it will be an error.
Several usages of
This article mainly introduces the PHP automatic loading autoload Mechanism example, the file structure is as follows, 2 ways to implement automatic loading, the need for friends can refer to the following
1, Custom function
2,spl_autoload_register
This article mainly introduces the PHP implementation of the simulation landing and send the user the method of sending messages, can be sent text, pictures and graphic functions, involving PHP for the interface of the relevant operation skills, the
See a few symbols about PHP today. One is @, this is added to the front of a variable, to suppress the PHP interpreter error, that is, even if the error is not displayed.
See a few symbols about PHP today. One is @, this is added to the front of a
For PHP programmers, the most difficult point to grasp is the PHP abstract class application of this piece of knowledge. As a novice is not yet to use object-oriented knowledge to program, but later development, using classes to encapsulate or use
Php's namespace (namespace) is only available after php5.3. This concept is already very early in C #, and the namespace in PHP is actually the same as the C # concept.
Why should I use namespace in PHP?
Assuming that you do not use namespace, the
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