Re: [RFC] Alternative syntax for Nowdoc.

From: Date: Tue, 29 Jun 2021 17:06:31 +0000
Subject: Re: [RFC] Alternative syntax for Nowdoc.
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-115215@lists.php.net to get a copy of this message
---- En mar, 29 jun 2021 18:40:05 +0200 Rowan Tommins <rowan.collins@gmail..com> escribió ---- > > The big advantage of heredoc and nowdoc syntax is that you can choose > the delimiter to be something that you know won't occur in the string. > For instance: > > $markdown = <<<'MD' > PHP has lots of ways to write strings: > ``` > $example = 'hello'; > $example = "hello"; > $example = <<<EXAMPLE > hello > EXAMPLE; > $example = <<<EXAMPLE > hello > EXAMPLE; > ``` > MD; > > > Unless I'm missing something, your proposed syntax would just be a *more > verbose* way of writing single quotes. Hi, Rowan, Basically, you're right. This would be a Heredoc variant of writing text without worrying about quotes (singles or doubles). Something like: $quote =``"Sometimes it's better to leave something alone, to pause, and that's very true of programming." - Joyce Wheeler``; Regards Manuel Canga

« previous php.internals (#115215) next »