#25006 [Opn->Bgs]: Call-time pass-by-reference has been deprecated

From: Date: Sun, 10 Aug 2003 22:45:14 +0000
Subject: #25006 [Opn->Bgs]: Call-time pass-by-reference has been deprecated
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-45667@lists.php.net to get a copy of this message
ID: 25006 Updated by: helly@php.net Reported By: marcus at gooseflesh dot de -Status: Open +Status: Bogus Bug Type: Variables related -Operating System: Windos 2000 +Operating System: * PHP Version: 4.3.2 New Comment: You of course cannot pass a constant as a reference. So you also cannot pass NULL by eference. But you can pass a pareameter set to NULL of course: function t(&$p) {} $x = NULL; t($x); Having said the above it should be clear why you can't initialize function parameters which are passed by reference. The initialization value would be a const. Seems you should redesign your apps/libs to something that makes more sense. Previous Comments: ------------------------------------------------------------------------ [2003-08-10 17:30:35] marcus at gooseflesh dot de Description: ------------ I have really big problems with your newest change to php. having Call-time pass-by-reference has been deprecated without having objects passed-by-reference makes the usability of your language really impractical. example: function foo($var); // is by-value if you pass an object it will be copied. function foo(&$var); // is by-reference but you cannot pass null or a value. foo(17); // error foo(null); // error function foo(&$var = null); // error Because you have unsuitable method signiture overloading and now no call-time pass-by-reference an efficient way of designing applications or libraries in your language is now impossible. It's a pity. At the moment I don't feel like to finish my php projects. Marcus ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25006&edit=1

« previous php.bugs (#45667) next »