PHP Core
Nested ternary operators without explicit parentheses
Nested ternary operations must explicitly use parentheses
to dictate the order of the operations. Previously, when used
without parentheses, the left-associativity would not result
in the expected behaviour in most cases.
Parentheses are not required when nesting into the middle operand,
as this is always unambiguous and not affected by associativity:
Array and string offset access using curly braces
The array and string offset access syntax using curly braces is
deprecated. Use $var[$idx] instead of
$var{$idx}.
(real) cast and is_real() function
The (real) cast is deprecated,
use (float) instead.
The is_real() function is also deprecated,
use is_float() instead.
Unbinding $this when $this is used
Unbinding $this of a non-static closure
that uses $this is deprecated.
parent keyword without parent class
Using parent inside a class without a parent
is deprecated, and will throw a compile-time error in the future.
Currently an error will only be generated if/when the parent is
accessed at run-time.
allow_url_include INI option
The allow_url_include
ini directive is deprecated. Enabling it will generate
a deprecation notice at startup.
Invalid characters in base conversion functions
Passing invalid characters to base_convert(),
bindec(), octdec() and
hexdec() will now generate a deprecation notice.
The result will still be computed as if the invalid characters did not exist.
Leading and trailing whitespace, as well as prefixes of type 0x (depending on base)
continue to be allowed.
The hebrevc() function is deprecated.
It can be replaced with nl2br(hebrev($str)) or,
preferably, the use of Unicode RTL support.
Implode with historical parameter order
Passing parameters to implode() in reverse order
is deprecated, use implode($glue, $parts)
instead of implode($parts, $glue).
Multibyte String
Passing a non-string pattern to mb_ereg_replace()
is deprecated. Currently, non-string patterns are interpreted as
ASCII codepoints. In PHP 8, the pattern will be interpreted as a
string instead.
Passing the encoding as 3rd parameter to mb_strrpos()
is deprecated. Instead pass a 0 offset, and encoding as 4th parameter.