A good PHP learning experience will be made between php4 and php5.
Source: Internet
Author: User
A good PHP study: php4 and php5 will go through a little bit to understand that the php space was activated yesterday. The php version is installed on the server, and PHP is used to write things in the past 20 days, the platforms built by myself are all php5. of course, I am very careful when writing, because almost every piece of code has its key points first checked for reference and then written, then, we can see that php4 supports those newly added in php5. After the results are uploaded, they cannot be modified !!
1. modify the class method call in the string. the string is written as follows in php5:
$ Htmlstr = <getuserinfo ('name')} "> user information
HTML;
Finally, I have to change PHP4:
$ User = $ dataobj-> getuserinfo ('name ');
$ Htmlstr = <user information
HTML;
2. back-to-back problem of class method calls, which I wrote in php5 as follows:
$ User = $ dataobj-> readrecord ()-> d_user;
In the end, I have to change it to PHP4.
$ Row = $ dataobj-> readrecord ();
$ User = $ row-> d_user;
I want to add () as follows:
$ User = ($ dataobj-> readrecord ()-> d_user;
Let the object be reversed first, then call the attribute on the object, and then discard the object. However, it turns out that php4 has no such support capability !!
3. the default parameter of the function, which I wrote in php5 as follows:
Function set ($ a, $ B = 3 ){
Echo $ B;
}
The call writes set (4 );
In php4, the default value of $ B cannot be obtained. For more information, see func_num_args (), func_get_arg (), and func_get_args () functions.
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