Functional Programming in PHP - The book

After working hard on the guide to Functional Programming in PHP I am pleased to announce that it has been published by php[architect]! The book is offcially now available and you can purchase your very own copy! If you’re a programmer who wants less bugs and easier testing then this is the functional introduction for you. Throughout the chapters I gently lead you through the various functional constructs available in and with PHP.

Read On →

Functional Programming on Three Devs and a Maybe

I was recently invited to join Edd and Michael to appear on the Three Devs and a Maybe podcast to discuss function programming. The recording of our chat is now available so head on over and have a listen. If you haven’t listened to the podcast before there are some 34 past episodes archived there as well! note If you are interested in finding out more about my book on functional programming in PHP or to subscribe for notification of its release please visit functionalphp.com or follow @FunctionalPHP on Twitter.

HHVM vs Zephir vs PHP: The showdown

Since its inception the slow running speed of PHP has been widely publicised and over the years there have been a number of improvements. The first Zend Engine arrived with PHP4 and delivered various performance enhancements (among other features). Each release since this time has delivered some sort of increased efficiency in one way or another. It has become more interesting recently however with three projects looking for improvements in different ways.

Read On →

Functional PHP talks

I was recently invited to speak about functional programming in PHP for both BrightonPHP and PHP Hampshire. The details of which are in a previous blog post. If you attended either talk and you’ve yet to leave feedback then please do on the respective Joind.in pages: Brighton PHP joind.in page PHP Hampshire joind.in page You can view the slides from the sessions on my website. I created the slides using reveal.js and my pandoc boilerplate project.

Read On →

Speaking about Functional PHP at BrightonPHP and PHP Hampshire

I have been invited to speak at both the upcoming meetings of BrightonPHP and PHP Hampshire about functional programming. This is off the back of the site I created for my (soon to be released) book tentatively entitled Functional Programming in PHP. To get a better idea of what the talk will include I have prepared an abstract: In the PHP world functions are generally sneered at due to their simplicity and perceived as an evil side effect of spaghetti code.

Read On →

Add a duration or interval to a date

In PHP you can easily add a duration to a DateTime instance in a number of ways. I will review the most common methods for completing the task starting with those available on the DateTime object itself. If you are running PHP 5.2 then the only way to achieve this is to call the modify method. This allows you to pass in a date format, but in this case we are most interested in the relative formats.

Read On →

Reverse a git pull request on GitHub the hard way

As you may know I am currently the maintainer of both Idiorm and Paris; well recently I merged in what looked to be an innocuous pull request from a contributor. Unfortunately this merge had unintended consequences and basically broke the backwards compatibility of the library. Shame on me! After waiting for a patch that would fix the problem and coming up short I decided enough was enough. So today I backed out the errant merges in both Idiorm and Paris.

Read On →

Convert UTC/GMT or any time zone to local time in PHP

Wrangling dates and times can be a somewhat arduous task for all programmers. One very common requirement is to convert a time from one time zone to another. In PHP this is greatly simplified with the DateTime standard library classes and especially DateTimeZone. For this example let us assume we have a UTC date and time string (2011-04-27 02:45) that we would like to convert to ACST (Australian Central Standard Time).

Read On →

Conditionally loaded responsive content on the client side

Sometimes it is helpful to entirely change chunks of markup when a certain CSS media query is triggered. This could because a certain layout will not work on smaller screen sizes or because it refers to media that you would not want a mobile to download. Recently I had this exact problem when dealing with a site that included a grid based layout in a carousel/slider. When the browser was sized down from desktop it needed to change the number of columns in the grid.

Read On →

Idiorm and Paris 1.4.0 Released

After a lot of work and many contributions from valued community members Idiorm and Paris versions 1.4.0 have been released into the wild. You can download them now from their respective repositories or via Composer/Packagist. As you are probably aware from my previous posts Idiorm is a minimalist ORM that is targetted at PHP 5.2 and above. It combines a fluent query builder with a simple ORM interface to allow fast and easy access to databases over PDO.

Read On →

Improve PHP session cookie security

The security of session handling in PHP can easily be enhanced through the use of a few configuration settings and the addition of an SSL certificate. Whilst this topic has been covered numerous times before it still bears mentioning with a large number of PHP sites and servers having not implemented these features. To prevent session hijacking through cross site scripting (XSS) you should always filter and escape all user supplied values before printing them to screen.

Read On →

Copyright © 2003 - 2015 Simon Holywell. All rights reserved.