PHP
| : | |
|---|---|
| : | |
| : | |
| (): | |
| : | |
| : | |
| : | |
| : | |
PHP (. PHP: Hypertext Preprocessor «PHP: »; Personal Home Page Tools[4] « -») [5] , -. - , -.[6]
|
|
[]
PHP ( JSP, Perl , ASP.NET) , , , PHP.
- POST GET-, - ;
- (MySQL, MySQLi, SQLite, PostgreSQL, Oracle (OCI8), Oracle, Microsoft SQL Server, Sybase, ODBC, mSQL, IBM DB2, Cloudscape Apache Derby, Informix, Ovrimos SQL, Lotus Notes, DB++, DBM, dBase, DBX, FrontBase, FilePro, Ingres II, SESAM, Firebird / InterBase, Paradox File Access, MaxDB, PDO);
- HTTP-;
- HTTP-;
- cookies ;
- , ;
- , ;
- XForms.
PHP . TIOBE, , 2011 PHP 5 .[6] , PHP, Facebook, , Wikipedia .
LAMP - (Linux, Apache, MySQL, PHP).
[] GUI-
PHP , GUI-.
, Windows API . - open source WinBinder[9]. C php php_winbinder.dll. WinBinder , (. ) WinBinder. , , WinBinder WinAPI .
PHP .NET/Mono Phalanger. PHP Phalanger .NET-, .
[]
1994 Perl/CGI -, HTML-. Personal Home Page ( ). Perl , C PHP/FI (. Personal Home Page / Forms Interpreter « / »).
1997 - , C PHP/FI 2.0. Ÿ 1 % ( 50 ) - .[4]
PHP 3.0 , . 1997 , , . PHP 3.0 1998 .[4]
PHP 3.0 . PHP , , PHP , , API. . php «PHP: hypertext Preprocessor», «Personal Home Page».
1998 , PHP 3.0, PHP. PHP. , Zend Engine, 1999 . PHP 4.0, , 2000 . , PHP 4.0 , , , .
PHP 13 2004 . Zend (Zend Engine 2), . XML. , , Java. , , , , , . , , , PHP 5.0.
PHP [12] 2006 . [13][14] , , , POSIX «» , safe_mode, magic_quotes_gpc register_globals php.ini. .[15]. 2010 PHP6 [16] - . PHP6 , 5.4.
[]
PHP . , foreach, Perl.
- , . . PHP.
Hello world PHP :
<?php echo 'Hello, world!'; ?>
PHP , , <?php ?>. , , . PHP- HTML-, , :
<html> <head> <title> PHP</title> </head> <body> <?php echo 'Hello, world!'; ?> </body> </html>
<?php ?>, , <? ?> <script language="php"> </script>. , 6.0 ASP <% %> ( <? ?> <% %> php.ini).
$, . , . . , , heredoc- (, <<<).
PHP , HTML . (;), , if/else .
PHP : ( /* */), C++ ( // ) UNIX ( # ).
[]
:
:
[17] :
(integer) PHP (, 32- , , 2 147 483 648 2 147 483 647). , . (double), , ( 32- ±1.7×10308 ±1.7×10+308).
PHP (boolean), TRUE («») FALSE («»). 0, , «0», NULL FALSE. TRUE.
NULL . NULL. NULL , NULL, , unset().
«» (resource). , , , , , , . .
(array) . , . . php- , , , . for foreach. , , , .
PHP callback. 5.3 , , :
function($args..$argsN) use($ctxVar,$ctxVar1) { definition ; }
callback :
- ( );
- - ( );
- - , - ( ).
is_callable($var)
[]
$, . .[18] :
$a = 'I am a'; // $a echo $a; // $ $b = 'a'; echo $$b; // $ ( $ $b) echo ${'a'}; // $a function_name(); // function_name $c = 'function_name'; $c(); // function_name, $d = 'Class_name'; $obj = new Class_name; // Class_name $obj = new $d(); // Class_name $obj->b; // b $obj->c(); // c() $obj->$b; // a , $b = 'a' $obj->$c(); // function_name() , $c = 'function_name'
PHP echo print [19] ( print ), . .
[]
(. Superglobal arrays) PHP , global. ( GET-, POST, . .).
, $GLOBALS $_REQUEST, , PHP ( ). , $_GET['year'] $HTTP_GET_VARS['year'] ( : «» ).
- $GLOBALS
- ( ).
- $_SERVER ( $HTTP_SERVER_VARS)
- , .
- $_ENV (. $HTTP_ENV_VARS)
- (. Environment variables). , .
- $_GET (. $HTTP_GET_VARS)
- GET-, URI «?».
- $_POST (. $HTTP_POST_VARS)
- HTML- POST. name HTML-.
- $_FILES (. $HTTP_POST_FILES)
- POST . , «name» , , , :
- ['name'] .
- ['type'] MIME- . PHP , , .
- ['size'] .
- ['tmp_name'] . move_uploaded_file. PHP .
- ['error'] . , 0 (UPLOAD_ERR_OK).
- $_REQUEST
- $_GET, $_POST, $_COOKIE. PHP 4.1 $_FILES.
- $_SESSION (. $HTTP_SESSION_VARS)
- .
[] -
PHP - , .
PHP class. (public, ), (protected) (private). PHP , ( extends ). ( implements). , . , . parent.
PHP (. Magic methods), . (__construct(), 5.0 , ) (__destruct()), (__get()) (__set()), (__sleep()) (__wake()), (__clone()) . : , .
new, ->. $this.
class C1 extends C2 implements I1, I2 { private $a; protected $b; function __construct($a, $b) { parent::__construct($a, $b); $this->a = $a; $this->b = $b; } public function plus() { return $this->a + $this->b; } /* ............... */ } $d = new C1(1, 2); echo $d->plus(); // 3
PHP, :
class a { public $color = 'red'; } $a = new a(); echo $a -> color; // red $b = $a; $b -> color = 'blue'; echo $a -> color; // blue
«Paamayim Nekudotayim» « ». , , . , . «Paamayim Nekudotayim» . , Zend Engine 0.5 ( PHP3), Andi Zeev [20] . «Paamayim Nekudotayim» « » . PHP.[21]
<?php class MyClass { const CONST_VALUE = ' '; } // :: echo MyClass::CONST_VALUE; ?>
[]
PHP- [1], :
- ,
- ,
- -,
- - ( ).
, . PHP ; .[22]
[]
, «», . , , , , , PDF . . , , , . PECL.
[]
PHP php.ini, , .[23] , , , , , , , . ini_set.[24]
[]
PHP:
- - SAPI ISAPI[25] (, Apache mod_php). - php- -. PHP :
- CGI. , - /usr/bin/php-cgi /path/to/script.php. php-cgi, , , -. FastCGI. , PHP [28][29], , PHP .
- , , ; . PHP GUI-[30] UNIX, Linux, Microsoft Windows, Mac OS X AmigaOS. , , Perl, Python VBScript
[]
:
_.php?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
, :
- Thies Arntzen ( 4.1.2, 4.2.2)
- ( Stig Bakken) ( 4.3.2, 4.3.3, 4.3.8 4.3.10)
- ( Zeev Suraski) ( 4.3.11, 4.4.0 4.4.4, 5.1.0, 5.1.2)
- ( 4.3.1, 5.0.0, 5.0.3)
- PHP ( 5.1.3 5.2.13)[31]
- PHP ( 5.3.0)[31]
PHP ZEND, :[31]
_.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 _.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42
PHP- php_logo_guid zend_logo_guid Zend.
PHP (4,5):[31]
_.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
[]
PHP -, , PHP . 2010 Facebook [32][33] PHP HipHop (HPHP, Hyper-PHP) C++, gcc.
.
| HipHop | PHP License | C++, |
| Roadsend PHP | GPL/LGPL | C, |
| Phalanger | Ms SS-PL[34] (Shared source) | Microsoft IL |
| Quercus ( - Resin) | GPL | JVM |
| PHC | BSDL | C, |
| Pipp[35] | Artistic License GNU GPL | Parrot |
phpclasses.org : PHP compiler performance.
[]
[] PHP
[] PEAR
[] -
- Drupal, Typo3, Mambo, Joomla, PHP-Nuke, Wordpress (CMS);
- Magento, osCommerce -;
- Coppermine, Gallery Project, 4images ;
- MediaWiki, DokuWiki -;
- phpBB, SMF, vBulletin, Invision Power Board ;
- phpMyAdmin, phpPgAdmin, Adminer ;
- eyeOS , Desktop Operating System.
[]
PHP , Zend Framework, CakePHP, Symfony, CodeIgniter, Kohana Yii[36].
[] PHP
[]
[]
PHP , , . , , array_, . str, . , , , , , . , , , .
PHP . , PHP , Perl. , , .
[]
, , [40]. , , , . , , , . : , .
5.3.x , [41], , . 5.3 Zend Optimizer. 2010 [42]
, . ( ), . , Python 3.x, Perl 6, , , perl- . , , . PHP 5.3.
[]
, UTF-8 mbstring iconv, , PHP 4.2.0 , mbstring.
[]
, PCNTL[43].
[]
[44]:
- PHP 20-45 ; PHP 30 78 % ;
- 95 % PHP ;
- 80 % PHP ; 17 %;
- 60 % PHP , 26 % , 8 % ;
[]
- 1 2 PHP Compiler Internals (.). 21 2011. 17 2009.
- PHP: Zend API: Hacking the Core of PHP Manual
- PHP 5.4.3 Release notes
- 1 2 3 PHP: History of PHP Manual
- PHP: Preface Manual (.). 21 2011.
- 1 2 TIOBE Software: Tiobe Index
- History of PHP and related projects (.). 21 2011.
- PHP: Manual (.) (21 2009). 21 2011. 13 2009.
- WinBinder home page
- Devel Studio
- Visual PHP Windows, DevelStudio
- news.txt PHP 6
- PHP 6
- , 2005
- PHP6
- PHP: Pseudo-types and variables used in this documentation - Manual
- PHP: Variable variables Manual
- PHP: echo Manual
- , C++, , , , .
- http://php.net/manual/en
- PHP: Basic memory management Manual (.) (13 2009). 21 2011. 17 2009.
- PHP: php.ini directives Manual (.) (6 2009). 21 2011. 13 2009.
- PHP: List of php.ini directives Manual (.) (6 2009). 21 2011. 13 2009.
- PHP: Installed as an Apache module Manual
- 1- mod_php vs CGI vs FastCGI
- PHP: HTTP- PHP Manual (21 2009). 21 2011. 13 2009.
- PHP | FastCGI
- PHP- 22 , FastCGI PHP
- PHP: PHP Manual (.) (21 2009). 21 2011. 13 2009.
- 1 2 3 4 PHP Easter Egg (.). 21 2011. 16 2009.
- HipHop for PHP: Move Fast
- Facebook PHP
- (.)
- Merkel Dirk Chapter 6: PHP Frameworks // Expert PHP 5 Tools. Packt Publishing, 2010. ISBN 978-1-847198-38-9
- Komodo IDE is a Professional Development Environment for Perl, Python, Tcl | ActiveState
- exUSSR
- PHP support for KDevelop 4 (and eventually Quanta+) | Milian Wolff
- PHP: Backward Incompatible Changes Manual
- PHP: Deprecated features in PHP 5.3.x. php.net Team. 21 2011.
- We plan to release a zend guard and runtime for php 5.3 later this year.. Zend Forums. 21 2011.
- PCNTL
- SuperJob.ru « PHP» 9 . Superjob.ru ( 2009 ).
[] .
[]
[]
- , . PHP. . .: «-», 2005. . 1120. ISBN 5-94157-245-
- . . PHP 5. .: «-», 2008. . 1104. ISBN 978-5-9775-0315-0
- . PHP: , , 3- = PHP Objects, Patterns and Practice, Third Edition. .: «», 2010. . 560. ISBN 978-5-8459-1689-1
- , . PHP MySQL: - = Beginning PHP and MySQL E-Commerce: From Novice to Professional. .: «», 2010. ISBN 978-5-8459-1602-0
- . PHP jQuery = Pro PHP and jQuery. .: «», 2010. . 352. ISBN 978-5-8459-1693-8
- , , . PHP MySQL. , 2- = PHP 6 and MySQL 6 Bible. .: «», 2010. . 912. ISBN 978-5-8459-1640-2
- . Web 2.0: PHP = Practical Web 2.0 Applications with PHP. .: «», 2009. . 544. ISBN 978-5-8459-1590-0
- , . PHP 5/6. .: «-», 2009. . 1024. ISBN 978-5-9775-0304-4
- , . - PHP. .: «-», 2007. . 608. ISBN 978-5-9775-0142-2
- -, , , -. PHP 5 = Professional PHP 5. .: «», 2006. . 608. ISBN 0-7645-7282-2
- , . PHP 5/6. 3- ., . . .: «-», 2009. . 672. ISBN 978-5-9775-0409-6
- , . PHP . Web-. 2- . . . .: «-», 2008. . 1264. ISBN 978-5-9775-0203-0
- , . PHP . 2- . . . .: «-», 2008. . 544. ISBN 978-5-9775-0204-7
- , . PHP . 2- . . . .: «-», 2011. . 400. ISBN 978-5-9775-0445-4

