[PHP] port from PHP 5.6.x to PHP 7.0.x incompatibility, 5.6.x7.0.x
1. handle errors and exceptions
1.1 set_exception_handler () function declaration type
Function handler ($ e ){
Var_dump ($ e );
}
Set_exception_handler ('handler ');
Throw new Exception ("sb ");
1.2 When the internal constructor fails, an exception is always thrown.
1.3 parsing error will throw a ParseError exception
1.4 E_STRICT Warning Level Change
2. Variable Processing
2.1 changes in indirect use of variables, attributes, and methods
$ Foo ['bar'] = 'a ';
$ A = 1;
Var_dump ($ {$ foo ['bar']}); // output 1
Var_dump ($ foo ['bar']); // output NULL
2.2 changes to the list () Handling Method
2.3 global only accepts simple variables. global variable variables are not recommended.
2.4 parentheses near function parameters no longer affect behavior
3. foreach changes
3.1 foreach no longer changes the internal array pointer
3.2 foreach uses the value traversal, and the operation value is a copy of the array
3.3 foreach provides better iteration features by referencing the Time History
3.4 non-Traversable object Traversal
4. integer changes
4.1 The hexadecimal string is no longer considered a number, and filter_var () is converted.
4.2 \ u {may cause errors
4.3 bitshifts bitwise conversion exceeds the range
4.4 Division By Zero error message
5. Adjust the string processing
6. removed Functions
6.1 set_magic_quotes_runtime () and magic_quotes_runtime () abolished
6.2 replace call_user_method () and call_user_method_array ()
Call_user_func () and call_user_func_array ()
6.3 All ereg * Functions
6.4 mcrypt alias
6.5 All ext/mysql Functions
6.6 All ext/mssql Functions
6.7 intl alias
6.8 dl () in PHP-FPM
6.9 GD Type1 functions
7. INI configuration commands removed
8. Others
8.1 objects created by the new operator cannot be assigned to variables by reference.
8.2 invalid classes, interfaces, and trait naming. Trait is a code reuse mechanism designed for PHP-like single-inheritance languages.
8.3 removed ASP and script PHP labels
8.4 initiate a call from an unmatched Context
8.5 yield changed to the right join Operator
8.6 function definitions cannot contain multiple parameters with the same name
8.7 The Switch statement cannot contain multiple default blocks.
8.8 viewing the parameter value in the function will return the current value
8.9 $ HTTP_RAW_POST_DATA is removed
8.10 INI file # comment format removed
8.11 JSON extensions have been replaced by JSOND
8.12 when the value overflows, the internal function will fail
8.13 fixed the returned value of the custom session processor.
8.14 order of equal elements in sorting