News for hackers. Stuff that matters.
Re:Union Types have been accepted for PHP 8 by chx on Saturday November 09, 2019 @01:21PM (#21493200)
Objects are enforced and a simple declaration can make PHP enforce the scalars as well. https://3v4l.org/6UU2v https://3v4l.org/q1PAq In PHP 7.4 due in a few weeks covariant return types / contravariant arguments will arrive. https://stitcher.io/blog/new-in-php-74#improved-type-varianc...
Re:Union Types have been accepted for PHP 8 by sedeki on Saturday November 09, 2019 @01:26PM (#21493242)
It seems as if declare(strict_types) works for scalars as well (first example)?

However, if I remove that declare from your latter example, only one output is shown.

Edit: Nevermind, I get it.