Bug #67977 [Opn->Nab]: Is it the expected behaviour?

From: Date: Mon, 08 Sep 2014 11:53:04 +0000
Subject: Bug #67977 [Opn->Nab]: Is it the expected behaviour?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187445@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67977&edit=1 ID: 67977 Updated by: fa@php.net Reported by: admin at mvpro dot net Summary: Is it the expected behaviour? -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Linux Debian Wheezy x64 PHP Version: 5.5.16 Block user comment: N Private report: N New Comment: 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. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Yes, hardly any (if any at all) of the string functions directly manipulate on the argument(s) given. They all return a modified copy of the string, as indicated by the "Return Values" section of the manual: http://php.net/strtolower Previous Comments: ------------------------------------------------------------------------ [2014-09-08 11:32:52] admin at mvpro dot net Description: ------------ Hi. I have a question - is it the expected behaviour that lines like strtolower($str); Do not equals to $str = strtolower($str); ? The second line is correct and works fine, but first - is not. No errors produced, but also it just does not work :) $str most likely is being lowercased, but string $str stay untouched. The same is with other functions like wordwrap($text, 20, "<br />\n"); Do not equals to $newtext = wordwrap($text, 20, "<br />\n"); In all cases i expect, that action will be performed and string changes. However it does not happen. Thanks in advance. Test script: --------------- <?php $str = "Mary Had A Little Lamb and She LOVED It So"; $str = strtolower($str); echo $str . PHP_EOL; // Prints mary had a little lamb and she loved it so echo 'It works fine (all symbols are in lowercase)' . PHP_EOL; ?> <?php $str2 = "Mary Had A Little Lamb and She LOVED It So"; strtolower($str2); echo $str2 . PHP_EOL; // Prints Mary Had A Little Lamb and She LOVED It So echo 'It does not work (string is the same)' . PHP_EOL; ?> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67977&edit=1

« previous php.bugs (#187445) next »