As a result of an engine rewrite with focus on more efficient data structures, PHP 7 offers much improved performance and memory usage. This session describes important aspects of the new implementation and how it compares to PHP 5. A particular focus will be on the representation of values, arrays and objects.
37. $i = 42;
$j = $i;
7
$i value = 42
LONG
$j value = 42
LONG
38. $i = 42;
$j = $i;
$k = $i;
7
$i value = 42
LONG
$j value = 42
LONG
$k value = 42
LONG
39. $s = “foobar”;
7
$s value
STRING
refcount = 1 type_info
hash = 0x80000652FDE460BE
len = 6
f o o b a r 0
40. $s = “foobar”;
$t = $s;
7
$s value
STRING
$t value
STRING refcount = 2 type_info
hash = 0x80000652FDE460BE
len = 6
f o o b a r 0
41. $s = “foobar”;
$t = $s;
$u = $s;
7
$s value
STRING
$t value
STRING
$u value
STRING
refcount = 3 type_info
hash = 0x80000652FDE460BE
len = 6
f o o b a r 0