📜 ⬆️ ⬇️

Transition to PHP 5.3

Some of those who develop applications for PHP have already downloaded and started testing new features of the largest change in the language over the past 7 years, but most developers are not interested in new features that can be applied in future developments, but changes that will affect the work already written applications.

Updated:The good news is that if you write code in accordance with current trends, then your applications will be affected by quite a few changes. Those whose code is focused on earlier versions of the language are waiting for merry times. The article provides a list of key points that should be paid attention to developers porting applications with PHP 5.2.

The above list of innovations is not final, but on the Internet in general and in the changelog in particular, you can find comprehensive information on new features and changes.
')

Array Functions


Prior to version 5.3, many of the functions of working with arrays could take both an array and an object as arguments and, as a result, produce the desired result. In 5.3, many of them now accept only arrays. If you want to access the properties of an object using any of the functions below, you need to first convert the object into an array.

Changes to magical methods


Up to 5.3 these methods could be declared not only as public, but also as private, protected static, etc. Starting from 5.3, the methods listed below cannot be static and must be public:

Ministry of Health warns


PHP has a list of functions that have been marked for deletion. Most of them are not of common use, but nevertheless you should check the code for the fact of their absence. These features are:
In addition, a number of directives in PHP.INI suffered the same fate, they will now throw out E_DEPRECATED warnings when activated:
In version 5.0, the is_a () method was marked as not recommended in favor of the instanceof, but in spite of this it was not removed from the language, and plus to everything, it ceased to throw out E_DEPRECATED.

Table ordered


The following 2 words are now reserved:
Given the nature of these two keywords, it is very unlikely that they are in your code, however, it would be nice to scan the code for their presence. If they exist, the parser will be gurazzo, as it is not well understood in PHP © . In general, they cannot be used as function names, class names, etc.

That's all, for more detailed information, look in the guide to the transition to 5.3 and comments on the news about the release, as well if someone has already renounced the new version - be sure to leave a comment through the form below.

Progg it

PHP 5.3 BBQ Release Party München


For brothers Slavs living in Munich (Germany), or nearby: PHP 5.3 BBQ Release Party München July 17, 2009. it. English

image

PHP 5.3 BBQ Sponsors:Supported by:PS
In continuation of the topic about GOTO one of the comments on the original article:
  1. goto future; echo 'PHP 5 . 2 .x'; future: echo 'PHP 5 . 3 .x';
  2. goto future; echo 'PHP 5 . 2 .x'; future: echo 'PHP 5 . 3 .x';
  3. goto future; echo 'PHP 5 . 2 .x'; future: echo 'PHP 5 . 3 .x';
  4. goto future; echo 'PHP 5 . 2 .x'; future: echo 'PHP 5 . 3 .x';
The positive sponsor is good old Russian folklore and the goal of excellent ska .

Source: https://habr.com/ru/post/63926/


All Articles