+593 99 022 3684 dime@hassler.ec
Photo by Roman Bozhko on Unsplash
Behold, a perfectly normal-looking PHP function

Start With Default Values

$key = false by default

Return Early and Often

Why go through the whole function, when we know the return value early enough?

Be Explicit, Not Implicit

return true? or false?

Prefer Form Over Function

What the hell?

SOURCE: https://levelup.gitconnected.com/write-clean-php-code-or-else-aac64bb9ae

Zachary Flower

WRITTEN BY

Zachary Flower

Professional nerd, avid indoorsman, aspiring polymath.
_
Level Up Coding

Level Up Coding

Si continuas utilizando este sitio aceptas el uso de cookies. más información

Los ajustes de cookies de esta web están configurados para "permitir cookies" y así ofrecerte la mejor experiencia de navegación posible. Si sigues utilizando esta web sin cambiar tus ajustes de cookies o haces clic en "Aceptar" estarás dando tu consentimiento a esto.

Cerrar