PHP and the Gem Within

23 11 2017

Flickr: by Hetx

Ubiquitous and lithe, little characters, popping up anywhere from user-defined functions to control structures and class definitions, PHP’s curly braces depending on circumstances may exhibit a distinctly Perlish quality. Perl exerts an influence since it figures as one among three languages from which PHP, indelicately-speaking, purloins much of its syntax. PHP’s connection to Perl also relates to its predecessor PHP/FI, originally a Perl hack that Rasmus Lerdorf later rewrote in the C Programming Language. To better appreciate PHP, certainly its Perlish facet merits inspection, and complex (curly) syntax, lends itself well to this endeavor.

Read the rest of this entry »


The Travails of Traversal

13 07 2016

Flickr: By JacobDavis

The venerated foreach-loop may seem to have formed a part of PHP from the outset, but it actually entered the language starting with PHP 4, apparently appropriated from Perl. While nowadays, this control structure provides a convenient way to iterate over an array or object without the complication of conditional looping inherent in for, while, and do-while loops, it was originally intended to provide a way to easily traverse arrays (see PHP Manual published 3-6-2003). Read the rest of this entry »

The Erroneous Basis of base_convert()

29 01 2016


July (Photo credit: kurafire)

Some bugs linger from one version of PHP to the next, such as the one associated with base_convert() and other base conversion functions. It has existed at least since the long, gone days of PHP 4. It even managed to escape the notice of Eevee in his encyclopedic rant railing against PHP a few years ago. An understandable oversight, given that nowadays developers usually apply themselves to other endeavors than converting values from one base to another. Read the rest of this entry »

PHP: Classy Dynamics

16 01 2016

flickr: by JusDaFax

Devotees of PHP may worry with the debut of PHP 7 that users have lost the beloved language we’ve known over the past twenty years. In truth, the newest version generally conforms to previous ones. In fact, the advent of PHP 7 heralds a technology distinguished by greater flexibility and consistency.

Read the rest of this entry »

Modulating the Modulo

28 11 2015

Flickr: by by Toño Garces


A recent article contrasting PHP with Ruby, denigrates making comparisons of one language with others, dismissing such efforts as worthless save for being a clickbait strategy. Yet, sometimes the best way to understand the familiar requires venturing out and exploring something new. If one only knows PHP, a developer may still write quality code. But, learning about C, JavaScript and Python, all of which have influenced PHP, may enhance one’s appreciation for its nuances.And, let’s not forget the other “P” in the pod, Perl, which had a pivotal bearing on PHP’s early development. Speaking of Perl, its creator Larry Wall drew inspiration from UNIX. Of particular interest, that operating system’s (OS) Bourne Shell has an open-sourced cousin bash (the “Bourne Again Shell”), knowledge of which may also enhance one’s appreciation for PHP. Read the rest of this entry »

The Real Error

22 07 2015

flickr: by Poulepondeuse

Sometimes a PHP script may produce an inconsistent type of error, i.e. in one version of PHP a less serious parse error displays while in another version a fatal error message appears.  Read the rest of this entry »

Hello, Again!

31 12 2014

Flickr: by rdohms

I chanced upon some amusing JAVA code today and decided to translate it into PHP. Here’s the code:

Read the rest of this entry »

%d bloggers like this: