The PHP podcast where everyone chimes in.


Originally aired on

March 10th, 2018

069: Catching Up With PHP Friends

We're still alive! We come off our hiatus to have an informal catch-up session with some PHP friends. And proof of the secret PHP Roundtable project is revealed to Chris & Joe.


Catching Up With PHP Friends Show Summary

Databases and Application State

  • Sometimes it's difficult to tell whether data should be hard-coded, or stored in the database. For example, a list of all 50 states in the United States.
  • Joe has worked with an e-Commerce business (back in early 2006) which worked with customers from multiple countries across the globe. In that case, it's good to have some kind of auto-updating system - even better if you can pull that from an external service that maintains the list for you, and then cache in your database.
  • It all comes down to how often the data changes. US states do not change often - they could go in config. But there are new zip codes being added constantly.
  • Chris' application looks up geolocation for IPs. In many cases, the IP range mapping to countries changes, so it's not really something you can keep in config.
  • Be wary of giving your credit card details to online services that provide a list of zip codes, because many of them are unreliable.
  • Smarty Streets API is one of those services that SammyK first implemented Codeception and Feature Acceptance Tests on. He was hitting the real API in his tests, and quickly ran up against the request limit!

Templating Engines

  • Smarty - both Chris and Joe have used in the past, but not recently.
  • Twig - currently used by SammyK for non-Laravel projects.
  • Blade - currently used by SammyK for Laravel projects.
  • Plates - Joe feels that this is pretty awesome, but doesn't get as much credit as it should.

If you're only getting into templating now, it's probably worth starting with Twig, because it will help you to do things properly.

Storing Poop Emojis in your Database

  • Make sure you're using MySQL's utf8mb4, you can't just use utf8.

Displaying right-to-left languages in HTML

  • Use the bdi element (bidirectional isolate)

Podcast Tips

  • Don't go months without a podcast, and then expect everything to flow and your guests to be sober! ;-)

Things That Nerds Care About That Don't Matter

  • Just go through PSR-2!
  • Tabs vs Spaces
  • Using carriage-returns instead of spaces ... what?!
  • Postgres - When you try to add a column to a table, you are forced to add it to the end!
  • Trailing commas - Joe feels that it looks wrong when the last item doesn't have a trailing comma
  • PHP 7.3 allows trailing commas in method calls!
  • Fixed-width fields in input files can cause PTSD
  • How to pronounce GIF (Graphics Interchange Format, 'giff' and 'jiff')
  • How to pronounce CSRF (Cross-Site Request Forgery, 'C-S-R-F' or 'c-surf')
  • How to pronounce XSS (Cross-Site Scripting, 'X-S-S' or other silly pronunciations)
  • How to pronounce CSPRNG (Cryptographically Secure PseudoRandom Number Generator, 'C-Spring' or 'C-Sprung' in past-tense!)
  • How to pronounce PRNG (PseudoRandom Number Generator, or 'Pring'??)
  • Trying to map programming concepts to the school environment
  • How many pivot tables in a relational database should you reach, before it's better to just use a graph database?
  • How to pronounce PNG (Portable Network Graphics, 'P-N-G' or 'Ping')
  • Where do extensions for PHP go to die? PECL! Not to be confused with Pickle.
  • Don't use gdb as an alias for 'git delete branch' if you also want to use the GNU Project Debugger!

The big reveal!

  • Watch the video from 48:52 to 50:55 for details!

Sammy Kaye wraps up with


Chris Tankersley

Joe Ferguson

Show Notes Credit

Shane Smith

Thank you Shane Smith for authoring the show notes for this episode!

If you'd like to contribute show notes and totally get credit for it, check out the show-notes repo!