Edit report at http://bugs.php.net/bug.php?id=15211&edit=1
ID: 15211 Comment by: php at guerrillamailblock dot com Reported by: dark_panda at hushmail dot com Summary: println? Status: Bogus Type: Feature/Change Request Package: Feature/Change Request PHP Version: 4.1.1 New Comment: ugly: echo "hello world\n"; # bad practice to use double quotes everywhere echo 'hello world', "\n"; # why do I have to write >>, "\n"<<? echo 'hello world', PHP_EOL; # oh boy nice: echoln 'hello world'; Same thing goes for println. Previous Comments: ------------------------------------------------------------------------ [2003-02-06 21:08:28] il...@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Given the number of print functions already in PHP this seem pointless, especially considering it'd only print a single character. ------------------------------------------------------------------------ [2002-06-08 10:38:26] bigredlinux at yahoo dot com Actually, what would be HUGE is if println could determine the sapi module it is running as and then add the endline appropriately, meaning for the web it would add a '<br clear="all" />' tag after the line. But honestly, if php is really going to be considered for commandline scripting, it needs a println() feature. ------------------------------------------------------------------------ [2002-01-24 13:36:56] dark_panda at hushmail dot com I'm in the midst of doing quite a bit of shell/command line stuff with PHP, and I think it would be kind of useful to have a println construct, much like in Java or a number of other languages. println is identical to print, but a newline/carriage return is appended to the output. I know I could just write function in PHP or even a function in an extension to provide the same functionality, but it might as well be in the language itself, if only because it may be used often enough to warrant inclusion. (I know I'd use it all the time.) I started trying to add it myself (I can see that it would go in the Zend engine, correct?) but after reminding myself that I've never used Lex before (nor really looked at the Zend code) I decided that this would be best left to someone who actually knows what they're doing when it comes to the Zend engine. The only problem I can think of is portability, specifically the oft-cursed differences between OS newline sequences. (Is it \n? \r\n? \n\r? Dammit?!) Doesn't seem like a huge issue, though, does it? J ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=15211&edit=1