By Harry Fuecks

Generating PHP with Ruby

By Harry Fuecks

Ran into an interesting article recently on PHP Web Site Generation using Ruby, over at (the site runs a PHP section here). The article makes a good starting point for exploring what works and what doesn’t.

Think PHP is underestimated where code generation is concerned, given how easy it is to generate and dynamically execute code e.g.;

< ?php // Some code $code = '

// Write code to file
file_put_contents('generated.php',$code); # PHP5 function!

// Include the generated code for execution
include 'generated.php';

Also interesting that Ruby (a dynamic language in more or less the same category as Python and Perl) was used as the generator.

The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account