PHP 4.0 Bug #4281: cannot use a referenced argument with defaulting

From: Date: Sun, 30 Apr 2000 01:36:01 +0000
Subject: PHP 4.0 Bug #4281: cannot use a referenced argument with defaulting
Groups: php.dev 
Request: Send a blank email to php-dev+get-18300@lists.php.net to get a copy of this message
From: andy@qabobala.xapnet.com Operating system: Linux 2.2.14 PHP version: 4.0 Beta 4 PHP Bug Type: Scripting Engine problem Bug description: cannot use a referenced argument with defaulting You cant use a reference with a default value (an optional function arg) when defining a function-- the parser will choke on this. function ($somearg, &$object_ref = 0) { if($object_ref == 0) { ... } else { ... } } Maybe this fails because php needs a predefined NULL - which is a reference to the NULL object. later...

« previous php.dev (#18300) next »