PHP: Difference between revisions

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Error Messages: REG_EMPTY
No edit summary
 
(74 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Computing]]: [[Software]]: [[PHP]]{{seed}}
<hide>
[[PHP]] is an interpreted language most commonly used in web sites.
[[page type::article]]
==Reference==
[[thing type::computer language]]
* [http://php.net/ Official PHP Website]
[[language type::interpreted]]
* {{wikipedia|PHP}}
</hide>
* [http://wiki.cc/php/Main_Page PHP Wiki]
==About==
[[PHP]] is an interpreted programming language most commonly used in web sites. It is the language in which the [[MediaWiki]], [[WordPress]], [[Drupal]], and [[ZenCart]] web software packages, among many others, are written.
 
Note that much of the information on this page is somewhat outdated; PHP continues to be actively developed and improved.
===subpages===
{| class="wikitable sortable"
! subpage name || type || about
{{!-!}} [[/arrays/]] || concept
{{!-!}} [[/CLI/]] || how-to || using PHP from a [[command line interface]]
{{!-!}} [[/criticism/]] || community || why PHP is bad
{{!-!}} [[/debugging/]] || how-to || especially [[/debugging/interactive|/interactive]]
{{!-!}} <code>[[/declare/]]()</code>: altering PHP behavior within a file, including strict typing
{{!-!}} <code>[[/enum/]]</code> || type/concept
{{!-!}} [[/file/]]-handling || how-to
{{!-!}} [[/frameworks/]]
{{!-!}} [[/function variable/]]: a variable can be a reference to a function
{{!-!}} [[/fx/]]: function documentation/notes
{{!-!}} [[/GUI/]]: graphical interface programming in PHP
{{!-!}} [[/installing/]]
{{!-!}} [[/inheritance/]] || syntax || rules
{{!-!}} <code>[[/interface/]]</code> || keyword
{{!-!}} [[/lib/]]raries || concept: collections of related functions that are provided as add-on modules
{{!-!}} [[/namespace/]]s || keyword/concept
{{!-!}} [[/operator/]]s || syntax || there are some relatively obscure ones that aren't well-indexed in the official documentation
{{!-!}} [[/referencing/]]: how variable references work
{{!-!}} <code>[[/ReflectionClass/]]</code> || native class || especially <code>[[/ReflectionClass/getParentClass|ReflectionClass::getParentClass]]()</code>
{{!-!}} <code>[[/resource/]]</code> || syntax/concept
{{!-!}} {{l/pfx|/resource/|stream}} || a particular type of resource
{{!-!}} [[/string/]] || type/functions
{{!-!}} <code>[[/trait/]]</code> || keyword/concept || including "[[/trait/use|use]]" in the context of traits
{{!-!}} [[/type declaration/]]
{{!-!}} <code>[[/use/]]</code> || keyword || "use" has 3 different meanings in PHP
{{!-!}} [[/XML/]] || libraries
|}


==Related Articles==
==Related Articles==
* [[Perl vs. PHP]]
* [[Apache and PHP]]: getting the two of them to work together nicely
* [[Perl vs. PHP]]: comparisons between the two languages
* [[register_globals]]
* [[register_globals]]
==Related Things==
===offsite===
===Coding Resources===
* [[wooz:2021/11/25/PHP documentation gripe]]: a misunderstanding about type-compatibility in method overrrides
* [[wikipedia:PHP Extension and Application Repository|PHP Extension and Application Repository]] (PEAR)
** [http://pear.php.net/ official web site]
===Users Groups===
* [http://www.tripug.org/ Triangle PHP Users Group]: [[The Triangle, NC]]


==Links==
==Links==
* '''2006-07-22''' [http://blog.case.edu/gps10/2006/07/22/why_global_variables_in_php_is_bad_programming_practice Why Global Variables in PHP is Bad Programming Practice]
===Reference===
* [http://www.ukuug.org/events/linux2002/papers/html/php/ Experiences of Using PHP in Large Websites]
* [http://php.net/ Web]
* [http://dagbrown.livejournal.com/19338.html un-PHP-ing my web site]: a LiveJournal entry critical of PHP
** [http://php.net/manual/ Manual]
==Notes==
*** [http://php.net/manual/en/langref.php Language Reference]
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]]. [http://www.wellho.net/forum/Writing-PHP/use-strict.html 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).
**** [http://php.net/manual/en/language.constants.predefined.php Magic constants]
===Error Messages===
**** [https://www.php.net/manual/en/language.namespaces.rules.php Name resolution rules]
''some of these are not found in the PHP documentation''
**** parameter types: [http://php.net/manual/en/functions.arguments.php Function arguments] (aka type hinting)
* '''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.
**** [https://www.php.net/manual/en/reserved.variables.php Predefined variables]
* '''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])
* {{wikipedia}}
** 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.
 
===Social===
* [https://twitter.com/official_php Twitter]
 
===Projects===
* [https://www.phptherightway.com/ PHP The Right Way]: good practices and patterns
* [http://www.hardened-php.net/ Hardened PHP]: patches to improve PHP security
* [https://3v4l.org/ 3v4l.org] "is an online shell that allows you to run your code on my server. I compiled more than 200 different PHP versions (every version released since 4.3.0) plus HHVM for you to use."
====Development Tools====
* [http://phpundercontrol.org/ phpUnderControl] - "Continuous Integration for PHP"
====Users Groups====
* [http://www.tripug.org/ Triangle PHP Users Group]: [[The Triangle, NC]]
====Coding Resources====
* [[PEAR]] (PHP Extension and Application Repository):
** [http://pear.php.net/ Official]
** {{wikipedia|PEAR}}

Latest revision as of 23:50, 26 March 2026

<hide> page type::article thing type::computer language language type::interpreted </hide>

About

PHP is an interpreted programming language most commonly used in web sites. It is the language in which the MediaWiki, WordPress, Drupal, and ZenCart web software packages, among many others, are written.

Note that much of the information on this page is somewhat outdated; PHP continues to be actively developed and improved.

subpages

subpage name type about
arrays concept
CLI how-to using PHP from a command line interface
criticism community why PHP is bad
debugging how-to especially /interactive
declare(): altering PHP behavior within a file, including strict typing
enum type/concept
file-handling how-to
frameworks
function variable: a variable can be a reference to a function
fx: function documentation/notes
GUI: graphical interface programming in PHP
installing
inheritance syntax rules
interface keyword
libraries concept: collections of related functions that are provided as add-on modules
namespaces keyword/concept
operators syntax there are some relatively obscure ones that aren't well-indexed in the official documentation
referencing: how variable references work
ReflectionClass native class especially ReflectionClass::getParentClass()
resource syntax/concept
stream a particular type of resource
string type/functions
trait keyword/concept including "use" in the context of traits
type declaration
use keyword "use" has 3 different meanings in PHP
XML libraries

offsite

Reference

Social

Projects

  • PHP The Right Way: good practices and patterns
  • Hardened PHP: patches to improve PHP security
  • 3v4l.org "is an online shell that allows you to run your code on my server. I compiled more than 200 different PHP versions (every version released since 4.3.0) plus HHVM for you to use."

Development Tools

Users Groups

Coding Resources