#36029 [Opn->Bgs]: Can not parse NULL as reference
| From: | sniper@php.net | Date: | Mon, 16 Jan 2006 08:45:04 +0000 |
| Subject: | #36029 [Opn->Bgs]: Can not parse NULL as reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91988@lists.php.net to get a copy of this message | ||
ID: 36029
Updated by: sniper@php.net
Reported By: f dot engelhardt at 21torr dot com
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Linux
PHP Version: 5.1.2
New Comment:
Yes, but PHP is not C and references are not pointers.
Previous Comments:
------------------------------------------------------------------------
[2006-01-16 09:35:10] f dot engelhardt at 21torr dot com
Description:
------------
In C and most other programming languages it is possible to parse NULL
as a reference parameter to a function (a NULL-Pointer). In PHP i need
to allocate a variable, that can be given to the function. So there is
no way to parse a NULL-Pointer.
Reproduce code:
---------------
<?php
function bTest(&$paData)
{
if (is_null($paData))
{
// cleanup
return true;
}
// handle data
return true;
}
bTest(NULL);
?>
Expected result:
----------------
Should work
Actual result:
--------------
Fatal error: Cannot pass parameter 1 by reference in ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36029&edit=1