Suggestions for PHP

php.internals

Michael Virnstein

21 years ago
Hi there, what really would be nice, if PHP would have a more advanced way of quoting strings similar to Perl. E.g. the q{} and qq{} function are really helpful there or that i can use e.g. $var = !my string 'hallo'!; and i don't have to backslash ' and " inside the string. another thing that i find useful in Perl is the unless construct. I sometimes find it more readable to use "unless($error) {...} " instead of "if (!$error) {...}". I think this would be nice additions, perhaps you'll consider implementing them in future releases. Thanx

Andrey Hristov

21 years ago
Michael Virnstein wrote:
> Hi there, > > what really would be nice, if PHP would have a more advanced way of > quoting strings similar to Perl. E.g. the q{} and qq{} function are > really helpful there or that i can use e.g. $var = !my string 'hallo'!;
$var = "my string 'hallo'" If you want to have longer strings, use heredoc $var = <<< EOT Some text with double quotes(") as well as single ones(') and even $variables EOT;
> and i don't have to backslash ' and " inside the string. > > another thing that i find useful in Perl is the unless construct. I > sometimes find it more readable to use "unless($error) {...} " instead > of "if (!$error) {...}".
This reminds me my days when I used to program in Pascal. The latter has repeat until with reversed logic. It was PITA to find the expression for it.
> > I think this would be nice additions, perhaps you'll consider > implementing them in future releases. > > Thanx >
Andrey P.S. just my thoughts