I activated the PHP space yesterday and installed the PHP P4 version on the server. I started to use PHP to write things in the last 20 days. My own platforms are all PhP5. Of course I am very careful when writing them, because almost every segment Code The main points are to first check the reference and then write it out. Then we can see that those in the reference are supported by PhP4 and are 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 = <A href = "user. php? U = {$ dataobj-> getuserinfo ('name')} "> User Information </a>
HTML;
Finally, I have to change PhP4:
$ User = $ dataobj-> getuserinfo ('name ');
$ Htmlstr = <A href = "user. php? U = {$ user} "> User Information </a>
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 function parameter I wrote in PhP5:
function set ($ A, $ B = 3) {
echo $ B;
}< br> the call is set (4);
In PhP4, the default value of $ B cannot be obtained, you can use func_num_args (), func_get_arg (), and func_get_args () functions for reference. get variable length parameter