Is it possible to assume that there will be PHP 5 on the server?

I studied PHP, and a lot of time in books and tutorials that I read, functions appeared in PHP 5. I don’t know anything about the history of PHP, so I don’t know I don’t know if I can safely use these functions on most servers. I know in Python, adoption of new versions is very slow (3.x is used in some applications, 2.6 on most desktop computers, many server distributions, such as Red Hat, have versions already in 2.4).

Is there a similar situation in the PHP ecosystem? My server has version 5.2, but some servers still work with PHP 4? What version of PHP can I safely assume that the server will work?

+5
source share
6 answers

PHP 5 was released in 2004 , and PHP 4 reached the end of life at the end of 2007 . We can safely assume that the server has at least 5.0.

PHP 5.3 was released in 2009, but there are still major parts of the software that did not fully take into account everything that was changed in it; In addition, there are still distributions in their main support cycles (for example, fairly recent versions of Ubuntu and Debian) that do not have a default.

However, assuming PHP 5.2 is definitely safe.

+9
source

, PHP 5.2.x. , - . , PHP 5.3 - ... , , .

+6

, . , 2010 PHP4. , , PHP4 2010 . PHP 5.2, , .

+2

Distrowatch . : , RedHat PHP 5 RHEL 5.5, . ; , ( , RHEL 4).

, PHP- , , PHP. 5.2 .

+2

, :

http://phpadvent.org/2010/usage-statistics-by-ilia-alshanetsky

 PHP version    | usage at the end of 2010
 ---------------+----------------------------
 4.4            |  6%
 4.4            | 16%
 5.1            |  8%
 5.2            | 66%
 5.3            |  4%

( 2011 )

http://w3techs.com/technologies/details/pl-php/5.3/all

 5.3            |  8.6%      (from 6.6%/0.764)
+1
source

Most hosting providers use PHP5. Some of them still use PHP 4 and 5 in the hosting account. In any case, continue development in PHP5.

0
source

All Articles