I recently came across this really helpful PHP trick:
You can cast a numeric string to either
float, depending on its contents, by simply adding
var_dump("1" + 0); // int(1) var_dump("1." + 0); // float(1) var_dump("1.0" + 0); // float(1) var_dump("1.5" + 0); // float(1.5)
That's much cleaner than trying to make a conditional cast yourself:
Markdown is one of the most popular markup languages on the web. Unfortunately, with no standard specification, every implementation works differently, producing varying results across different platforms. The CommonMark specification fixes this by providing an unambiguous syntax specification and a comprehensive suite of tests. In this session you'll learn about this standard and how to integrate the league/commonmark parser into their PHP applications. We'll also cover how to customize the library to implement new features like custom Markdown syntax or advanced renderers.
The Internet of Things (IoT) is fundamentally changing how we interact with the digital world. In this session we’ll explore the implementation of real examples which bridge the gap between the physical and digital world using PHP: asking Alexa for information within a PHP application; displaying API data on an Arduino-powered display; using PHP to control LEDs on a Raspberry Pi to monitor application uptime; and connecting IR sensors to Slack to see whether a conference room is in use.
All Things Open 2017
Software bugs are inevitable; some are especially difficult to track down, causing you to waste countless hours before throwing your hands up in defeat. It doesn't have to be this way! The mental fatigue and wasted time can be avoided by using strategies like identifying the most-appropriate tool, taking a logical & objective approach, challenging assumptions, listening to variables, isolating the code path, and reinforcing code with automated tests.
Interview with Colin O’Dell
In this episode I chat with Cal Evans about PHP, Alexa skills, and ZendCon 2017!
I recently inherited a legacy PHP project built on a closed-source framework where all the core classes were encrypted with IonCube. Not knowing what classes and methods exist makes it extremely difficult to use that functionality. In order to make life easier, I set out to create a
stubs.php file listing all of those "hidden" classes and methods.
To celebrate this milestone I thought I'd share the story of how this package came about, how it's grown, and how I couldn't have reached this milestone without the PHP community's help.