Difference between revisions of "PHP"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(→‎Notes: REG_ERANGE)
(→‎Error Messages: REG_EMPTY)
Line 24: Line 24:
 
===Error Messages===
 
===Error Messages===
 
''some of these are not found in the PHP documentation''
 
''some of these are not found in the PHP documentation''
* '''REG_ERANGE''': This error appears to originate in the [[regex]] library, and means "Invalid character range, e.g. ending point is earlier in the collating order than the starting point."
+
* '''REG_EMPTY''': [[regex]]-related, but not sure what it means; it may reflect a difference between Perl-style regex (preg_* functions) and grep-style regex (ereg* functions). I changed the expression "('|")" to "['"]", and this seemed to solve the problem.
 +
* '''REG_ERANGE''': This error appears to originate in the [[regex]] library, and means "Invalid character range, e.g. ending point is earlier in the collating order than the starting point." (Documented [http://www.laurikari.net/tre/api.html here])
 
** In one case, this was caused by having a forward-slash ("/") in the bracketed list of possible characters; escaping the forward slash fixed the problem.
 
** In one case, this was caused by having a forward-slash ("/") in the bracketed list of possible characters; escaping the forward slash fixed the problem.

Revision as of 16:11, 30 September 2007

Computing: Software: PHP

This page is a seed article. You can help HTYP water it: make a request to expand a given page and/or donate to help give us more writing-hours!

PHP is an interpreted language most commonly used in web sites.

Reference

Related Articles

Related Things

Coding Resources

Users Groups

Links

Notes

One of the major weaknesses of PHP as a serious programming language is its lack of any way to require variable declaration before usage -- the equivalent of "use strict;" in Perl or "Option Explicit" in Visual Basic. Here is a brief discussion of this problem, with a workaround which might be useful in some situations (but not if you need to turn off warnings for other reasons, such as needing to suppress messages about duplicate http headers).

Error Messages

some of these are not found in the PHP documentation

  • REG_EMPTY: regex-related, but not sure what it means; it may reflect a difference between Perl-style regex (preg_* functions) and grep-style regex (ereg* functions). I changed the expression "('|")" to "['"]", and this seemed to solve the problem.
  • REG_ERANGE: This error appears to originate in the regex library, and means "Invalid character range, e.g. ending point is earlier in the collating order than the starting point." (Documented here)
    • In one case, this was caused by having a forward-slash ("/") in the bracketed list of possible characters; escaping the forward slash fixed the problem.