alternate syntax for PHP
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
hotpotato
tests
.gitignore
LICENSE
MANIFEST.in
README.rdoc
VERSION
setup.py

README.rdoc

Python Hot Potato

PyHP is an alternate syntax for PHP

Examples

% cat > test.py <<END
a,b = 2,3
print_r([x**(a*b) for x in [1,2,3]])
END
% PYTHONPATH=. bin/pyhp test.py
<?php
$__pyhp_assign_0__ = array( 2, 3 );
$a = array_shift( $__pyhp_assign_0__ );
$b = array_shift( $__pyhp_assign_0__ );
;
$__pyhp_lstcmp_0__ = array(  );
foreach ( array( 1, 2, 3 ) as $x) {
$__pyhp_lstcmp_0__[] = pow($x, $a * $b);
};
;
print_r( $__pyhp_lstcmp_0__ );
% python -m hp test.py | php
Array
(
    [0] => 1
    [1] => 64
    [2] => 729
)

Inspiration