Seven: a compatibility library like "Six", but between Python and PHP :)
A simple toolbox containing all the pieces of Python (functions, methods, etc.) that are missing or differently implemented in PHP.
It's useful for making easier the porting of a project (Python to PHP) or as a support for a polyglot or Python developer writing in PHP.
Table of Contents
Tested and developed on version: 7.2.*
Use Composer to install the requirements needed
All the helper functions are outside namespaces and autoloaded by Composer to be used wherever in the code as globals.
Example: use the
array_setdefault helper function
// With default value $result = array_setdefault($array, $key, $default); // Without default value $result = array_setdefault($array, $key);
The source code is hosted on GitHub.
Use Composer to install also the requirements for development and testing (Composer's default behavior)
or use the
Tests are executed using PHPUnit also for coverage.
Pull requests are welcome!
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.