ID:               21433
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Any
 PHP Version:      4.2.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

I don't think this will be implemented, since this is partially why
heredocs were created.

The only thing I can tell you is, you should use stuff like:
echo "it is: ".++$value;


Previous Comments:
------------------------------------------------------------------------

[2003-01-05 10:35:03] [EMAIL PROTECTED]

I'm relatively new to PHP.
Previously I used to program a lot in Perl.
What I really lack in PHP is Perl's ability to interpolate any
expression inside a string.
For example:

Perl: "Next value is @{[ $value + 1 ]}!"
PHP:  "Next value is " . $value + 1 . "!"

In this simple case it's not a great problem, but it becomes more
awkward when using the heredoc operator. In this cases I'm often forced
to use temporary variables:

$tempvar = $value + 1;
print <<< END
Here it is the next value

$tempvar

Other text...

END;


I propose to extend the Variable Parsing syntax to evaluate ANY
expression instead of variables only.
I propose the following syntax:

print <<< END
Here it is the next value

{$= $value + 1 }

Other text...

END;


Using "{=" would be more readable but it would cause too many backward
compatibility problems...

What do you think of this?

Thanks.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21433&edit=1

Reply via email to