php 5.2-> 5.4 버전업 문제 해결

출처 :
http://smallmir.tistory.com/201

ereg 계열 함수 사용시 오류 메시지.

ereg,eregi,ereg_replace

>>> stripos,str_ireplace,preg_replace,preg_match 등으로 대체

eregi  preg_replace 대체 가능.

eregi(‘123′,’123456’);

preg_replace(‘/123/I’,’123456′);

ereg계열에서는 대소문자 구분이

ereg  eregi  구분되었음.

그것을 preg_replace 에서는 /i   추가해주면 된다.

preg_match 같음.

split 함수 사용시 오류

>>> explode 함수로 대체. split  정규식을 지원했으나, explode  지원하지 않음.

session_register 삭제

 

//’eregi 함수사용을 권장하지 않는다’ 라는 메세지 출력.

Deprecated: Function eregi() is deprecated in /home/nuhome/web/nux/admin/plugin.php on line 3

파일 수정을 하지 않을시 임시방편

@error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT));

함수 인자에 변수를 참조로 전달할 수 없게됨

<?

function modify($array) {
$array[] = 'zero';
}
$array = array(0, 1, 2);
modify(&$array);

?>

PHP Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of modify(). in test.php on line 8

global 변수를 함수의 인자로 넘길 수 없음.

function test($_REQUEST){

}

magic_quotes_gpc에 대한 이해.

http://blog.naver.com/egirl5?Redirect=Log&logNo=110012870549

register_global off 처리

http://php.net/manual/kr/function.extract.php

사용을 하더라도 보안상 아래 순서에 맞게 덮어써주는 것을 추천합니다.

http://php.net/manual/kr/ini.core.php#ini.variables-order

EGPCS (Environment, Get, Post, Cookie, and Server)

> http://php.net/manual/en/language.variables.superglobals.php

extract($_ENV);

extract($_GET);

extract($_POST);

:

extract($_GET,EXTR_PREFIX_ALL,’_GET_’);

extract($_POST,EXTR_PREFIX_ALL,’_POST_’);

php 5.3 주요 변경 사항

http://kr.php.net/manual/en/migration53.incompatible.php

php 5.4 주요 변경 사항

http://kr.php.net/manual/en/migration54.incompatible.php

5.4 관련 한글 정리 문서

http://crizin.net/display/dev/What’s+New+in+PHP+5.4

댓글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다