Req #63418 [Com]: intval/strval pass-by-reference
| From: | mail+php at requinix dot net | Date: | Sat, 03 Nov 2012 00:37:48 +0000 |
| Subject: | Req #63418 [Com]: intval/strval pass-by-reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174494@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63418&edit=1
ID: 63418
Comment by: mail+php at requinix dot net
Reported by: ilyane at list dot ru
Summary: intval/strval pass-by-reference
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: Any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Call-time pass-by-reference has been explicitly removed from 5.4 and had a warning
in 5.3. You should not be using it at all.
If you don't want an assignment then use typecasting: var_dump( (int)$var )
Previous Comments:
------------------------------------------------------------------------
[2012-11-02 08:03:14] ilyane at list dot ru
Description:
------------
---
From manual page: http://www.php.net/function.intval
---
Why not to add pass-by-reference option?
That would be such a beautiful thing:
intval(&$var);
strval(&$var);
and so on...
Test script:
---------------
$var = "123";
intval(&$var);
var_dump($var); //int(123)
Expected result:
----------------
int(123)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63418&edit=1