use mode delegates in PHP

fixes #2197
fix php indentation
fix inline php mode
Merge pull request #2216 from adamjimenez/php-delegate

use mode delegates in PHP