A notice error occurs after a program written in php5.2 is switched to 5.3 ???

Source: Internet
Author: User
Php5.2 was used in the past, but recently it was found that the version was slightly lower, and it was switched to php5.3 (I used the phpstudy Combination Package). However, after switching, previously, the program written in php5.2 will receive a notice prompt, although it does not affect the running of the correct results. Which version should I use later...

Php5.2 was used in the past, but recently it was found that the version was slightly lower, and it was switched to php5.3 (I used the phpstudy Combination Package). However, after switching, previously, the program written in php5.2 will receive a notice prompt, although it does not affect the running of the correct results.

Image Description

Which version of php should I use in the future ?? I still like to use combination packages.

This is the error page code:


  "; // Echo"
Programming Language: $ t33 "; // print_r ($ t); echo" programming language: "; // Method 1: traverse the array, the last comma at that time cannot be avoided // foreach ($ t as $ key => $ value) {// echo $ value. ","; //} // Method 2: Use for loop $ len = count ($ tt); // obtain the length of the array $ str = ""; for ($ I = 0; $ I <$ len; $ I ++) {if ($ I = $ len-1) {// $ str. = $ tt [$ I]. ". "; $ Str = $ str. $ tt [$ I].". ";}Else {$ str. = $ tt [$ I].", ";}} echo $ str; echo"
Account: $ id "; echo"
Password: $ pwd "; echo"
Introduction: $ wb "; echo"
Car: $ car "; echo"
Faculty: $ yx ";?>! [Image description] [1] I don't think it's a code issue or a php version switch. What do you say ???

Reply content:

Php5.2 was used in the past, but recently it was found that the version was slightly lower, and it was switched to php5.3 (I used the phpstudy Combination Package). However, after switching, previously, the program written in php5.2 will receive a notice prompt, although it does not affect the running of the correct results.

Image Description

Which version of php should I use in the future ?? I still like to use combination packages.

This is the error page code:


  "; // Echo"
Programming Language: $ t33 "; // print_r ($ t); echo" programming language: "; // Method 1: traverse the array, the last comma at that time cannot be avoided // foreach ($ t as $ key => $ value) {// echo $ value. ","; //} // Method 2: Use for loop $ len = count ($ tt); // obtain the length of the array $ str = ""; for ($ I = 0; $ I <$ len; $ I ++) {if ($ I = $ len-1) {// $ str. = $ tt [$ I]. ". "; $ Str = $ str. $ tt [$ I].". ";}Else {$ str. = $ tt [$ I].", ";}} echo $ str; echo"
Account: $ id "; echo"
Password: $ pwd "; echo"
Introduction: $ wb "; echo"
Car: $ car "; echo"
Faculty: $ yx ";?>! [Image description] [1] I don't think it's a code issue or a php version switch. What do you say ???

This does not have much to do with the php version. Instead, you should develop a good programming habit. If you are not sure whether there is a value, you must determine whether it is output.

Otherwise, the error message "direct path" is reported.

You should change it:

If (isset ($ user ['yx ']) {echo $ user ['yx'];} // or if (! Empty ($ user ['yx ']) {echo $ user ['yx'];}

In addition, we recommend that you directly use the latest stable version, as:5.6.21

It has nothing to do with the version. If the variable is not defined, it will be used. Of course, an error should be reported! Note that you must first define non-predefined variables before using them!

In addition, the version is determined based on market share and specific projects.
We recommend that you use 5.6 in the production environment.
Of course, 5.3 is used at most 5.4, followed
7 fastest

$ Tt is not defined. In addition, this is irrelevant to the version. In this case, an error is reported, but the error setting levels of php. ini are different, so that you will not report an error if you think the error is 5.2.

Use isset to determine first

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.