php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38215 functions arg lists with &$var = 'some default' broken? (works in php 5)
Submitted: 2006-07-26 05:32 UTC Modified: 2006-07-30 08:35 UTC
From: php at elitecoders dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.4.2 OS: CentOS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at elitecoders dot com
New email:
PHP Version: OS:

 

 [2006-07-26 05:32 UTC] php at elitecoders dot com
Description:
------------
When a function argument list contains a variable reference 
which has a default value, there is no output. It may be 
because of a crash, but I was unable to test for that because 
I don't have access to the log files.

This reproduce code works as expected in php 5.

Reproduce code:
---------------
<?php

function exec_bug(&$var_ref = NULL) {


}

echo "working.";

?>

Expected result:
----------------
working.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-26 07:07 UTC] tony2001@php.net
Parse error: syntax error, unexpected '=', expecting ')'
You have to update your PHP version if you want to use this syntax.
 [2006-07-30 08:35 UTC] php at elitecoders dot com
When I ran the code it resulted in a completely blank 
window. Also blank when I viewed the source - No errors, 
nothing at all.

If I had gotten a parse error I would have re-written the 
code without posting a bug report.

Since you've gotten a parse error out of it though, I'll 
have to assume that; for some reason, the server I was 
testing on has php configured to not warn of parse errors.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 01:01:35 2025 UTC