{ PHP snippets }

Jason McCreary

Jason McCreary @gonedark

? Naming things is most certainly hard. I find full names aimed at relaying a human context yield the most readable code. Here are a few examples to help make naming things a little easier… https://t.co/U2AhdaSwUb

PHP
John T. Bonaccorsi

John T. Bonaccorsi @imjohnbon

? Easy way to improve code clarity: use the JSON_OBJECT_AS_ARRAY predefined constant to make the second parameter of json_decode human readable. https://t.co/Jm9XzlYgS2

PHP
Chris Fidao

Chris Fidao @fideloper

? Don't forget to index timestamp columns like "created_at" if you query against them. e.g.: ORDER BY created_at e.g.: WHERE published_at <= NOW() https://t.co/z8Jt4xMQTj

PHP
Jason McCreary

Jason McCreary @gonedark

A few ways to clean up the conditional code that forms most of your codebase. From simple to nested to spotting unnecessary conditions. ? https://t.co/qGVaDl3TKt

PHP
Laravel Shots

Laravel Shots @LaravelShots

TIL : "break" & "continue" accept arguments too. while (true) { while (true) { break 2; // break both loops } } echo "Hey";

PHP