class ShortTagExpander (View source)

Methods

string|null
expandCode(string $code, bool $expandShortEcho)

Replace the short PHP open tags to long tags (<? to <?php) and optionally the short echo tags (<?= to <?php echo).

Details

string|null expandCode(string $code, bool $expandShortEcho)

Replace the short PHP open tags to long tags (<? to <?php) and optionally the short echo tags (<?= to <?php echo).

Parameters

string $code

the code to be expanded

bool $expandShortEcho

expand

Return Value

string|null

return NULL if code didn't changed, the expanded code otherwise

Exceptions

InvalidArgumentException

if $code is not a string