ID: 36029
Updated by: [EMAIL PROTECTED]
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