(imageeps*) $HTTP_RAW_POST_DATA <%, <script language="php"> preg_match call_user_func[_array] stream_set_blocking migrate to TTF for rendering fonts file_get_contents("php://input") <?php // :p Extension: MySQL - Jump ship and migrate to PDO... or be lazy and migrate to MySQL Improved by adding "i" to all your functional calls... mysql_connect => mysqli_connect. Strongly consider restructuring for OOP. Extension: MSSQL - Migrate to PDO or SQLSRV.
to throw fatal errors now throw catchable Errors. You are now able to catch a lot more things than you were able to previous. May seeing some uncaught errors flying around afterwards. Fatal Error: Cannot declare class Error.
Throwable; ◦ Exceptions as usual. You should not notice [m]any differences with your existing error handlers for past exceptions. • Error implements Throwable; ◦ More kinda serious exceptions thrown by the engine instead of the old errors that you could do nothing about but laugh at.
empty. All things that used to spam E_STRICT things have been "downgraded". • E_DEPRECATED for old things. • E_NOTICE for dumb things you did. • E_WARNING for dumber things you did.
($Object->$Property)['Key']; Variable resolution is now left-to-right precedence. This means you WILL experience problems if you were not very explicit with your magical magic. This also means they are going to read really weird. Solution: Always Be Explicit... and TBH... just avoid this feature unless it is super clever.
1; // wat echo yield (-1); // thur we go Yield is now a right-to-left precedence keyword. Some things that read really odd before should read a bit nicer. Yield can now also yield another generator now to extend its iteration train. Yield can now also return a final value after-the-fact, retrievable by the GetResult method.
Now operates on a "copy" of the array while doing by-value looping (while still seeming to respect copy-on-write behaviour). This means appending during foreach() will not result in an extended loop. Appending during foreach() while doing a by-reference loop will now extend the loop consistently/properly. https://gist.github.com/bobmajdakjr/7553df62287cd534f31a
to split strings for you. Use str_split. The order of items has been normalised when appending onto an existing array with the []'s in the list. • list($A[], $A[], $A[]) = [1, 2, 3]; • PHP 5: $A = [ 3, 2, 1 ]; • PHP 7: $A = [ 1, 2, 3];
the hood which results in a few changes in how it handles floats. Less leeway on how bad you can malform them. The decimal cannot be the last thing anymore, in normal notation and science notation: • json_decode('42.'); // NULL • json_decode('42.e42'); // NULL Cut the decimal point out or append a zero: • '42', '42.0' • '42e42', '42.0e42'
name are no longer valid and is fatal. • function Whatevs($Thing, $Trash, $Trash, $Trash) { func_get_args now tracks the reference of the arguments rather than the value, but only if they were defined by the function signature...
longer valid and will throw an ArithmeticError. • $Result = 4 << -2; • $Result = 4 << $CalculatedShift; // :( Shifting too wide will always result in 0. • $Result = 1 << 9001; • int(0) Division by 0... Prepare your WTFing... • var_dump(3/0); // float(INF) (and a E_WARNING) • var_dump(-3/0); // float(-INF) (and a E_WARNING) • var_dump(0/0); // float(NAN) (and a E_WARNING) • var_dump(0%0); // CATCHABLE FATAL ERRRRRRRERRRR • used to just be warnings and bool(false) for all the things...
no longer valid when instantiating new objects. • $Object =& new Whatever; • Objects are already PBR... you do not want to pass an object by reference reference. If you think you do, you don't.
or weak typed. Files can declare they want super strict typing by adding a declaration at the top of the file. This (strict types) only affects the file in question and not calls to functions within the file from outside the file. The only way to allow "something or null" is with =NULL on the arg. There is no valid syntax like "?int" yet to mark it nullable. This also has the side effect of making it optional... which may not actually be desirable...
Then have it else have this other thing. Chainable, reading from left to right. Similar to the Ternary operator. It is safe to use on array keys which may not exist, similar to isset().
has been upgraded. Allows you to include debugging assertions within the code, with the ability to toggle them off so they have zero performance impact on production. Allows you to throw exceptions for things you may need to debug, but may not actually be fatal to the process. This is a multistep process. Expectations Via Assertions
Silent. This is done via two different INI directives. • assert.exception = 0 or 1 (default 0) ◦ 0 = Run the assertion but instead of throwing the exception, spew the exception as a Warning ◦ 1 = Run the assertion and exception it hard if it fails. ◦ Can be set via ini_set(). • zend.assertions = -1, 0, or 1 (default 1) ◦ 1 = Compile and Execute the assertion. (dev mode) ◦ 0 = Compile but skip the assertion. ◦ -1 = Skip it completely for Zero Impact. (prod mode) ◦ Cannot be set via ini_set(). Expectations Via Assertions (cont.)
a list of patterns to apply to the source data one at a time. Nice for shorthanding. Array of patterns where the key is the pattern and the value is the callback to execute. The return of the callback is what gets subbed in for the pattern.
to know about UTF characters and a lot of things you didn't want to know. Kinda an odd API... all static... With it though you can test anything about a character to determine how you should treat it.
{ public function Whatever() { } } • Calling static methods unstatically. ◦ They have no $this. ◦ Don't wait though on these, fix them now. • Custom salt param on password_hash ◦ Kinda a step backwards, but they think they are protecting you from yourself. • Stream SSL Contexts: capture_session_meta ◦ Session meta available via stream_get_meta_data