Skip to content
astorm edited this page Jan 4, 2016 · 8 revisions

Want to get started using or contributing to pestle? Start here.

Need help understanding how to pass arguments to your program? Read the arguments and options document

Why Pestle

Pestle grew out of my desire to write PHP in a "python like" way. That is, to have

  1. A non-default-global namespace
  2. The ability to import functions from other modules
  3. The ability to import all functions from other modules
  4. Small functions operating on scalar and list data

When PHP announced namespaces in PHP 5.3, I was initially excited. However, PHP 5.3 namespaces didn't have great support for functions. They understood functions, but the use keyword only worked with classes.

More modern versions of PHP (5.6+, 7.0) introduced the use function -- but this only works with already loaded PHP code files. i.e. you'd need to load all your module files at once. PHP solves this with classes using the SPL autoloader, but registered autoloaders don't fire for undefined functions. The use function is also missing the ability to load all the functions from a namespace. i.e. similar to python code that looks like this

import time;
print time.time();

PHP's evolution towards a class/interface based programming system is probably the right one for widespread adoption and business support, but I've always been curious what it would be like to work with PHP if it had gone the other way. That's part of what the pest project is about.

Clone this wiki locally