Swap – currency exchange rates library

Swap is a currency exchange rates library for PHP. It provides a single interface to conveniently work with currency exchange rates and integrates with more than a dozen of different exchange rates providers.

Awesome Interviews

Awesome Interviews is a curated awesome list of lists of interview questions. Technical interviews, mind you. It covers a wide range of areas from a variety of programming languages, frameworks and databases, to operating systems, data structures and algorithms. There also coding exercises and much more.

This list links to some really great resources for both candidates, who are preparing for the interviews, and interviewers who want to make their interviews better.

ULID – Universally Unique Lexicographically Sortable Identifier

If you thought that UUID was the end of universally unique identifiers, think again. Here’s the ULID spec, with the following improvements:

  • 128-bit compatibility with UUID
  • 1.21e+24 unique ULIDs per millisecond
  • Lexicographically sortable!
  • Canonically encoded as a 26 character string, as opposed to the 36 character UUID
  • Uses Crockford’s base32 for better efficiency and readability (5 bits per character)
  • Case insensitive
  • No special characters (URL safe)
  • Monotonic sort order (correctly detects and handles the same millisecond)

Here’s how it looks:

ulid() // 01ARZ3NDEKTSV4RRFFQ69G5FAV

And there’s a wide selection of libraries implementing ULID for all major programming languages.

Serverless PHP on AWS Lambda

For all those of you who want to try out Amazon Lambda with PHP, here’s a quick and simple guide as to how to set it up: Serverless PHP on AWS Lambda.

This is some pretty exciting stuff!

The best way to get the full PHP version string

Jeff Geerling shares the best way to get the full PHP version string.  I’d think that “php –version” externally or “echo PHP_VERSION” internally would do the job.  However, that’s not exactly right, as there are a number of inconsistencies on different platforms.  The best option seems to be the combination of the PHP_MAJOR_VERSION, PHP_MINOR_VERSION, and PHP_RELEASE_VERSION constants.

$ php -r 'echo join(".",[PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION]);'
7.2.12