php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19582 Easier Heredoc mode
Submitted: 2002-09-24 15:39 UTC Modified: 2002-09-24 15:43 UTC
From: agr at amigrave dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.3 OS: Debian GNU/Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: agr at amigrave dot com
New email:
PHP Version: OS:

 

 [2002-09-24 15:39 UTC] agr at amigrave dot com
Hello,

First of all, I would like to say (as hundreds of people says to you each day) that you're all doing a GREAT JOB !

I feel kinda stupid to ask you to consider this feature request, so please consider this as the only thing PHP should include to make my little person very very happy :))

Here's the point :
When dealing html which is not mine but generated by a graphist who use dreamweaver or something, I spent a lot of time (and I think lot of people too) quoting, cleaning, line breaking html code. This happens for parts of code which have to be repeated and have to contains output of variables and functions.

Then I discovered while reading the doc :) that php has perl- like HEREDOC mode. It sound cool !
I'm using this mode a lot, but when I want to output the result of a function, i'm forced to go out of the heredoc mode, or set a variable with the result of the function before using heredoc mode, and I think the code is getting ugly when doing this.

I think the heredoc mode would be very very cool if it was python like. I should use something like that.

echo """ Some html lines, $var $var2 
more html
more $vars """ . function_output() . """ more html ...""";

This would be very cool. But php is already very very cool !!

Again, thanks you all for keeping this great job !!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-24 15:43 UTC] jmoore@php.net
I dont think this syntax is particularly intuative and would lead to a lot of very ugly code.

Remember you only ever write the code once but you are likley to read it many times (fixing bugs etc) so you are better off spending a bit more time writing it and making it easier to understand.

Many thanks for your thoughts,

- James
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 16:01:27 2024 UTC