codeguy / php-the-right-way

An easy-to-read, quick reference for PHP best practices, accepted coding standards, and links to authoritative tutorials around the Web
https://www.phptherightway.com
Other
9.06k stars 3.24k forks source link

Type casting & arrays #863

Open zakirullin opened 4 years ago

zakirullin commented 4 years ago

With all that goodies documented, we still have a topic to think about.

Type casting in PHP is horrible and hard (means prone to errors). You shouldn't use that in 2020. Especially when dealing with requests/responses/configs/arrays and other raw data.

Untyped array is a problem also (with all those issets() nearby).

We came to an easy solution like this

You think the problem is worth describing?

zakirullin commented 2 years ago

@codeguy Hi there! Care to see the PR?

matthewtrask commented 2 years ago

@zakirullin yes please :)