moodLearning Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
php-upgrade-cheatsheet [2018/01/04 06:07]
serbizadmin [Cheatsheet for Upgrading PHP Sites]
php-upgrade-cheatsheet [2018/01/04 06:18]
malvin
Line 5: Line 5:
 Not that many organizations are prepared to deal with the change. So the [[https://moodlearning.com|moodLearning]] team has prepared a cheatsheet to cover some important technical changes to make it easier for people to transition to the new PHP  version. Not that many organizations are prepared to deal with the change. So the [[https://moodlearning.com|moodLearning]] team has prepared a cheatsheet to cover some important technical changes to make it easier for people to transition to the new PHP  version.
 ===== PHP 5.x to 7 ===== ===== PHP 5.x to 7 =====
 +Deprecated functions in php5
  
 +**Sample**
 +
 +<code><?php
 + 
 +class Sample {
 + 
 +   function Sample() {
 + 
 +       echo 'Hello World';
 + 
 +   }
 + 
 +}
 +?></code>
 +
 +**Fix for php7**
 +
 +If the function and class name is same change function name to <nowiki>__contstruct</nowiki>
 +
 +Sample
 +
 +<code><?php
 + 
 +class Sample{
 + 
 +   function __construct() {
 + 
 +       echo 'Hello World!';
 + 
 +   }
 + 
 +}
 + 
 +?></code>
 ===== See Also===== ===== See Also=====
   * [[http://php.net/manual/en/migration70.changed-functions.php|Changed PHP Core Functions]]   * [[http://php.net/manual/en/migration70.changed-functions.php|Changed PHP Core Functions]]