Wow, I didn't realize 8.0 was coming soon. RC1 is out now, with a GA projected for 2020-11-26.


wow FINALLY, this was my biggest Pet PHPeeve: "Access to undefined constants now always results in an Error exception."

· · Web · 1 · 0 · 3

PHP 8 is adding "Attributes": This RFC proposes Attributes as a form of structured, syntactic metadata to declarations of classes, properties, functions, methods, parameters and constants. Attributes allow to define configuration directives directly embedded with the declaration of that code.

Similar concepts exist in other languages named Annotations in Java, Attributes in C#, C++, Rust, Hack and Decorators in Python, Javascript.

Show thread

Neat, didn't expect this to change: "Non-strict comparisons between numbers and non-numeric strings now work by casting the number to string and comparing the strings."

So `0 == "foo"` changes from true to false in PHP 8.

Show thread

"Nested ternaries now require explicit parentheses." thank god

Show thread

Type hinting supports union types

Optional trailing comma in parameter lists

Nullsafe operator! $bar?->foo means your code works even if $bar is null.

Named. Fucking. Arguments. array_fill(start_index: 0, num: 100, value: 50);

Show thread

@annika what the heck is happening, why is php good

up is down and short is long

@00dani I'm so excited! I've been using PHP for 20 years, professionally for 12, and it's been an amazing transformation. Steady improvement since PHP 5.3 back in like 2009.

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!