Fun and Functional Programming in PHP with Macros
I was so excited about my previous article about PHP macros, that I thought it would be fun for us to explore the intersection of macros and functional programming.
PHP is already full of functions, with object oriented patterns emerging relatively late in its life. Still, PHP’s functions can be cumbersome, especially when combined with variable scope rules…
In this example, we see
languages defined as a list of programming languages. Each programming language is combined with a constant prefix and the resulting array is logged to the console.
Compare this to similar PHP code:
Continue reading %Fun and Functional Programming in PHP with Macros%
LEAVE A REPLY
You must be logged in to post a comment.