This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
php-upgrade-cheatsheet [2018/01/02 04:06] serbizadmin created |
php-upgrade-cheatsheet [2020/06/13 15:10] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Cheatsheet for Upgrading PHP Sites ====== | ====== Cheatsheet for Upgrading PHP Sites ====== | ||
| + | The change that recently rocked the dev world was the sunsetting of PHP 5.x and moving PHP to version 7. (Don't ask us where version 6 is.) Also in the horizon is [[https:// | ||
| + | \\ | ||
| + | \\ | ||
| + | Not that many organizations are prepared to deal with the change. So the [[https:// | ||
| + | \\ | ||
| + | \\ | ||
| + | {{ :: | ||
| ===== PHP 5.x to 7 ===== | ===== PHP 5.x to 7 ===== | ||
| + | ==== Deprecated Functions in php5 ==== | ||
| + | |||
| + | **Sample** | ||
| + | |||
| + | < | ||
| + | |||
| + | class Sample { | ||
| + | |||
| + | | ||
| + | |||
| + | echo 'Hello World'; | ||
| + | |||
| + | } | ||
| + | |||
| + | } | ||
| + | ?></ | ||
| + | |||
| + | **Fix for php7** | ||
| + | |||
| + | If your class has a constructor having the same name as your class name, then it is now deprecated in PHP 7. Change constructor to < | ||
| + | |||
| + | Sample | ||
| + | |||
| + | < | ||
| + | |||
| + | class Sample{ | ||
| + | |||
| + | | ||
| + | |||
| + | echo 'Hello World!'; | ||
| + | |||
| + | } | ||
| + | |||
| + | } | ||
| + | |||
| + | ?></ | ||
| + | \\ | ||
| + | \\ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== See Also===== | ||
| + | * [[http:// | ||