Welcome to PHP Changed Behaviors’s documentation!¶
Contents:
- Per PHP version
- PHP Changed Behavior
- array And callable Cannot Be Absolute
- Array Has No Absolute Name
- No Abstract Private Method In Traits
- Accessing Trait Resources Directly Is Not Allowed
- Alias Replace Class
- Anonymous Class Name Includes Extends
- array_key_exists() doesn’t work on objects
- array_merge() And Variadic
- Negative Automatic Index From Empty Array
- Automatic Index In Non Empty Array
- Array Usage With String Initialisation
- array_product() New Checks
- array_sum() Checks Operands Thoroughly
- assert Is Reserved Function
- assert() Throws Exception
- Auto-initialization From Boolean
- Using __autoload() is deprecated
- Backed Enum Values Needed To Compile
- Back-tick Operator Is Deprecated
- Bitshift And Concat Precedence
- Boolean Used As Array
- Calling Non-Static Method Statically
- Accessing Directly Properties In Trait
- Cannot Call Traits Methods Directly
- No Case With A Semi-colon
- PHP Constants Are Not Case Insensitive
- Cast In Const
- Catch Without Variable
- ceil() Strict Mode
- class_alias() Works On Internal Classes
- ::class On Object
- Underscore Named Class
- Clone A Constant
- Can Clone Readonly Properties
- compact() Throws Notice On Missing Variable
- Interface Imported Constant Visibility Is Checked
- Constants In Trait
- Constants With Objects
- Parameter Contravariance
- convert_uuencode() Works On Empty Strings
- count() Must Count Countable
- Returntype Covariance
- Creating Object On Null
- cUrl Moved Away From Resource
- Array Syntax With Curly Braces Are No More
- datetime With Multiple Signs
- Constant %s is deprecated
- Destructuring Non Arrays
- Die And Exit As Functions
- No More dir() With Null
- ${expression} is deprecated
- Dot And Bitshift Priority
- Dot And Minus Changed Precedence
- Dot And Plus Changed Precedence
- Duplicate Static Definition
- Dynamic Class Constant
- No Dynamic Properties By Default
- E_STRICT Is Deprecated
- E_USER_ERROR Is Deprecated
- each() Has Been Removed
- Enforcing Native PHP ReturnType
- Enforcing Return Type With Spl Classes
- eval() Without Try
- explode() Forbids Empty Strings
- Cannot Explode() Null
- Method export() in Reflection Is removed
- file_get_contents() Needs A Real Path
- FilessytemIterator Skips Dot Files
- Final Class Constants
- Final Method In Trait
- Final Promoted Properties
- Finfo Moved Away From Resource
- Float Used As Array
- fputcsv() Needs Escape Parameter
- func_get_arg() Changed Behavior
- Generators Don’t Return
- get_called_class() Cannot Be Called Outside A Class
- get_class() Needs An Argument
- get_defined_functions() Doesn’t Exclude Diabled Functions Anymore
- get_object_vars() Does Not Work On ArrayObject
- No Dynamic Global Variables
- $GLOBALS Assignement
- Copy Of $GLOBALS
- Heredoc Syntax In An Array
- Default Values With htmlspecialchars()
- http_build_query() supports enumerations
- $http_response_header Is Deprecated
- Implicit Array Key Conversion
- Implicit Nullable
- implode() Arguments Order
- in_array() String Int Comparisons
- in_array() Doesn’t Confuse 0 And Empty String
- Increment Non-alphanumeric
- Increment On Boolean Is Deprecated
- Indirect Modification In Clone
- Inegality Comparisons
- Init Readonly Properties In Child Class
- instanceof Expect Objects
- Integer Used As Array
- Interface Constant Visibility Checks
- Interpolated String Dereferencing
- Calling Static Methods On Strings
- Integer Non-silent Conversion
- Base Conversion Reports Invalid Characters
- isset() On Constants
- iterator_count() Also Count Arrays
- jsonSerialize Must Have Return Type
- Keywords In Namespace
- krsort() Places Integers Before Strings In Keys
- ksort() now uses regular comparison
- ksort() Now Places Integers Before Strings
- libxml_disable_entity_loader() Is Deprecated
- Duplicate Enum Cases Are Not Linted Anymore
- Covariance And Contravariance Are Fatal
- __FUNCTION__ In Closure Changed
- match Is Now A Keyword
- No Max() On Empty Array
- max() Must Contain At Least One Element
- max() On String And Integer
- mb_convert_encoding() Has Deprecated Formats
- Integer Regex With mb_ereg_replace()
- mb_strrpos() Third Argument Is Not Encoding
- No min() On Empty Array
- min() Doesn’t Accept Empty Arrays
- mixed Is Now A Keyword
- No New Line In Namespaces
- Named Parameters And Variadic
- Negative Index On Strings
- Negative Offset With Strings
- Nested Attributes
- Never Arrow Function
- never Is Now A Keyword
- Direct calls on new
- New Cases In Switch
- Call Method On New
- __sleep() Method Enforces Return Type
- Non-canonical Cast
- Non Static Method Called Statically
- No Reference To $GLOBALS Variable
- Not In A Closure
- Null Used As Array
- Null As Array Offset
- Null With array_key_exists()
- PHP Warns When Finding Unconvertible Characters
- Old Constructors
- Old Style Constructor
- Only First Byte
- Optional Parameter Are After Compulsory Parameters
- Orphaned Parent
- parent Cannot Be Used Anymore In Callable Arrays
- Passing Objects Is Deprecated
- $php_errormsg has been removed
- Plus And Concat Precedence
- printf() Warns About Unknown Formats
- range() Uses Single Byte Strings
- range() Lists Everything Between Strings
- range() With Int And String
- (real) Is Replaced By (float)
- Recursive Comparison Of Arrays
- Reflection Doesn’t Return Self
- Reflection Doesn’t Return Static
- Relative Callable In Strings
- Relaxed Naming With Class Constant
- Return Reference On Void
- PHP native return types are now enforced
- round() Mode Validation
- self Cannot Be Used Anymore In Callable Arrays
- __set_state() Method Must Be Static
- set_exception_handler() Must Update Its Type To Throwable
- setlocale() Does Not Affect Echo Anymore
- sort() Places Integers Before Strings
- Sorting Closure Must Return Integers
- Spaces In Namespaces
- spaceship Operator Results
- SplFixedArray Is Now An IteratorAggregate
- Cannot Bind $this To Static Closure
- static Cannot Be Used Anymore In Callable Arrays
- Static Variables Are Linked To Their Method
- Storage Of Static Properties Trait
- Static Variable Accepts Functioncalls As Default
- Static Properties With References
- str_pos() Requires Only Strings
- str_replace() Checks For Arguments
- str_replace() On Arrays Of Objects
- str_replace() Enforces Strings In Array Argument
- strftime() And gmstrftime() Are Deprecated
- String Increments
- String To Integer Comparison
- Strings Are Bigger Than Integers
- strpos() With Out-Of-Range Offset Is A Fatal Error
- strpos() Emits TypeError
- strpos() Emits ValueError
- strpos() Does Not Accept False
- strpos() With Integer Argument
- strpos() Does Not Accept Null As Second Parameter
- strpos() With Null Haystack
- strsplit() With Empty String
- str_split() Throws ValueError With Negative Lengths
- substr() Returns Empty String On Out Of Bond Offset
- switch() Changed Comparison Style
- Length Of tempnam() Has Been Raised
- Tentative Static Returntype With Datetime
- Ternary Associativity
- $this Must Be The Local Object
- throw Is An Expression
- __toString Can Throw Exceptions
- Trailing Comma In Arguments
- Trailing Comma In Calls
- Constants In Traits
- Typed Class Constant
- Removing $this from a closure is deprecated
- Undefined Constants
- Unpack Arrays In Arrays
- Unpack Array With String Keys
- unserialize() Checks The End Of The String
- unserialize()
max_depthOption - unserialize() Error Report
- Unserialize with the upper case S is deprecated
- (unset) Was Removed
- var_export() Format
- var_export() With Stdclass
- version_compare() Stricter Operators
- vsprint() Requires An Array
- vsprintf() Returns Empty String On Error
- each() Is No More
- Comment Inside yield from
- Yield Must Use Integer Or String Keys
- Cannot Raise Zero To Negative Powers
- PHP Error Messages
- Silent changed behaviors