Recently, PHP has become one of the most popular scripting languages by virtue of its powerful functions and simple and easy-to-use features. This article will show the titles that are easily presented by tough users during the application of PHP.
Recently, PHP has become one of the most popular scripting languages by virtue of its powerful functions and simple and easy-to-use features. This article describes the titles that are easily displayed by tough users during PHP application, including syntax errors, program running errors, and logic errors, hope to help users who are currently learning the PHP language. In addition, this article will summarize the various issues that should be paid attention to during the PHP programming process at the end of the article for your reference.
One obvious feature of PHP script language is that it can take the initiative to generate an instance of variables without requiring users to declare the variables to be applied. This feature is worth a lot of effort, but it also paves the way for the scripting program you have written. In good terms, users no longer need to declare every variable to be applied in the program at the beginning of the program, just like the C language. However, now, you must be very cautious with the accurate spelling of each variable name. Otherwise, new variables may be created unintentionally. Some programming languages, such as PERL, can record the information of variables that have only been applied once in the program, and issue a warning prompt based on the user's preset settings. In addition, PERL also provides a powerful debugger. As of version 4.0.2, the PHP language does not contain a debugger. However, this does not affect the popularity and promotion of PHP language. PHP provides a very wide range of functions, even compared with mature programming languages such as C language. It can be said that PHP is currently one of the most convenient and effective scripting languages for WEB support.
Next, let's get back to the point and take a look at what titles are easily presented in the PHP programming process, and what measures should be taken accordingly.
Just as we usually need to end each sentence when writing an article, we must end each statement in the PHP request program with a semicolon. This is the most basic syntax, but it is also the easiest way to present titles. When writing a program, we seldom check whether a semicolon is missing in a row or line, but once any negligence is displayed, the parsing program will issue an error report immediately. Sometimes, the report may contain the number of statements that display the title.
$ Output = "Hello World ";
Echo $ Output
$ Other = "Blah ";
Print $ SomeMoreText;
?>
A semicolon is missing at the end of "echo $ Output" in the second line of the above code. if this script is executed, the following error message will be generated:
Parse error: parse error, expecting '','' or '';'' in/usr/local/apache/htdocs/test. the php on line 8 report certainly points out the cause of the rendering error, that is, the comma "," or semicolon ";" is omitted, but the statement of the rendering title is set to the eighth line. Because this code is very simple, we can easily find the place where the error is actually presented. However, if the program is very complex, it would be hard to find out the errors.