WEB언어/PHP
PHP 5.x 에서 PHP 7으로 업그레이드시 작업
saltdoll
2017. 6. 15. 05:16
반응형
PHP 5.x 에서 PHP 7으로 Migration(Upgrade) 작업해야 할 사항들.
PHP 7이 속도 향상의 크게 영향을 주기에, 사이트에 소스 Upgrade도 한번 쯤 생각하게 만듭니다.
해당 부분은 PHP7으로 업그레이드 할때, 변경해야 하는 사항들 메뉴얼에 나온 부분들 입니다.
Migrating from PHP 5.6.x to PHP 7.0.x
http://php.net/manual/en/migration70.php
Migrating from PHP 5.6.x to PHP 7.0.x ¶
Table of Contents ¶
- Backward incompatible changes
- New features
- Deprecated features in PHP 7.0.x
- Changed functions
- New functions
- New Classes and Interfaces
- New Global Constants
- Changes in SAPI Modules
- Removed Extensions and SAPIs
- Other Changes
Changed functions
http://php.net/manual/en/migration70.changed-functions.php
PHP Core ¶
- debug_zval_dump() now prints "int" instead of "long", and "float" instead of "double"
- dirname() now optionally takes a second parameter,
depth
, to get the name of the directorydepth
levels up from the current directory. - getrusage() is now supported on Windows.
- mktime() and gmmktime() functions no longer accept
is_dst
parameter. - preg_replace() function no longer supports "\e" (
PREG_REPLACE_EVAL
). preg_replace_callback() should be used instead. - setlocale() function no longer accepts
category
passed as string.LC_*
constants must be used instead. - exec(), system() and passthru() functions have NULL byte protection now.
- shmop_open() now returns a resource instead of an int, which has to be passed to shmop_size(),shmop_write(), shmop_read(), shmop_close() and shmop_delete().
- substr() and iconv_substr() now return an empty string, if string is equal to start characters long.
- xml_set_object() now requires to manually unset the $parser when finished, to avoid memory leaks.
반응형