Folding for PHP