Version November 2014 November 2015 May 2016 PHP 5.3 14.85% 9.90% 2.43% PHP 5.4 28.61% 22.09% 7.64% PHP 5.5 48.87% 50.68% 29.56% PHP 5.6 7.67% 22.09% 39.67% PHP 7.0 - 1.17% 20.24% Source: seld.be
Version November 2014 November 2015 May 2016
PHP 5.3 14.85% 9.90% 2.43%
PHP 5.4 28.61% 22.09% 7.64%
PHP 5.5 48.87% 50.68% 29.56%
PHP 5.6 7.67% 22.09% 39.67%
PHP 7.0 - 1.17% 20.24%
Source: seld.be
Centralised analysis of marketing budgetsCross-Channel-Tracking and Customer JourneyOptimizing marketing budget based on individualattribution modelsAutomatically optimise SEM- & RTB-Budgets via Cross-Channel-Bid Management
Mature, monolithic enterprise application
Lots of data to collect, filter and analyze
predates Unit-Testing
GETTING STARTEDSwitch the PHP-Version on my dev machine
:~$ sudo a2dismod php5 && sudo a2enmod php7.0 && sudo service apache2 restart
Reload the applicationPHP Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /home/richard/...
MYSQLPHP5
$myEscapedString = mysql_escape_string($myString);
PHP7$myEscapedString = mysqli_real_escape_string($dbLink, $myString);
DIVIDE BY ZEROvar_dump(3/0);
var_dump(0/0);
var_dump(0%0);
PHP5PHP Warning: Division by zero
bool(false)
PHP Warning: Division by zero
bool(false)
PHP Warning: Division by zero
bool(false)
PHP7PHP Warning: Division by zero
float(INF)
PHP Warning: Division by zero
float(NAN)
PHP Fatal error: Uncaught DivisionByZeroError: Modulo by zero
JSON_ENCODE$inf = 3/0;
$nan = 0/0;
$myArray = array(
$inf,
$nan
);
var_dump(json_encode($myArray));
PHP5string(13) "[false,false]"
PHP7bool(false)
VARIABLE INTERPOLATION$obj>$properties['name']
PHP5$obj>$properties['name']
PHP7$obj>$properties['name']
SESSION_SET_SAVE_HANDLERPHP5.3
function emptyFunction()
session_set_save_handler(
"emptyFunction",
"emptyFunction",
"emptyFunction",
"emptyFunction",
"emptyFunction",
"emptyFunction"
);
PHP7function emptyFunction()return true;
session_set_save_handler(
"emptyFunction",
"emptyFunction",
"emptyFunction",
"emptyFunction",
"emptyFunction",
"emptyFunction"
);
NULL COALESCING OPERATORPHP5
$myVar = isset($_GET['attributeName']) ? $_GET['attributeName'] : 'defaultValue';
PHP7$myVar = $_GET['attributeName'] ?? 'defaultValue';
$myVar = $_GET['attributeName'] ?? $_GET['fallbackAttributeName'] ?? 'defaultValue';
SCALAR TYPE HINTINGfunction getNumber(int $intNumber) : int
return $intNumber;
var_dump(getNumber(3)); // int(3)
var_dump(getNumber("5")); // int(5)
var_dump(getNumber(2.87)); // int(2)
var_dump(getNumber(false)); // int(0)
var_dump(getNumber(true)); // int(1)
var_dump(getNumber("foo")); // PHP Fatal error
CONCLUSIONUpgrading to PHP7 is not that hardPHP7 might be a huge boost in performanceCleaner and more stable codeBut......it will not solve all your problems