Source: stitcher.io

PHP 8.2 in 8 code blocks
readonly class PostData { public function __construct( public string $title, public string $author, public string $body, public DateTimeImmutable $createdAt, public PostState $state, ) {}} https://stitcher.io/blog/new-in-php-82#readonly-classes-rfc $rng = $is_production ? new Random\Engine\Secure() : new Random\Engine\Mt19937(1234); $randomizer = new Random\Randomizer($rng); $randomizer->shuffleString('foobar'); https://stitcher.io/blog/new-in-php-82#new-random-extension-rfc function alwaysFalse(): false { return false; } https://stitcher.io/blog/new-in-php-82#null,--true,-and-false-as-standalone-types-rfc function generateSlug((HasTitle&HasId)|null $post) { } https://stitcher.io/blog/new-in-php-82#disjunctive-normal-form-types-rfc trait Foo { public const CONSTANT = 1; public function bar(): int { return self::CONSTANT; }} https://stitcher.io/blog/new-in-php-82#constants-in-traits-rfc function connect( string $user, #[\SensitiveParameter] string $password ) { } https://stitcher.io/blog/new-in-php-82#redact-parameters-in-back-traces-rfc class Post {} $post = new Post(); $post->title = 'Name'; https://stitcher.io/blog/deprecated-dynamic-properties-in-php-82 enum A: string { case B = 'B'; const C = [self::B->value => self::B]; } https://stitcher.io/blog/new-in-php-82#fetch-properties-of-enums-in-const-expressions-rfc
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners