# Suggestions for PHP

- Thread: https://externals.io/message/12993
- Original archive: https://news-web.php.net/php.internals/12993
- Started by Michael Virnstein on 2004-09-26T09:32:26+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12993 — Michael Virnstein — 2004-09-26T09:32:26+00:00

URL: https://externals.io/message/12993#12993

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

---

## #12994 — Andrey Hristov — 2004-09-26T10:04:52+00:00

URL: https://externals.io/message/12993#12994 · In reply to: #12993

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
