php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3759 'unset' function argument keyword doesn't work?
Submitted: 2000-03-07 16:13 UTC Modified: 2000-03-07 16:13 UTC
From: befletch at my dot yahoo dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 4 Patch Level 1 OS: OpenBSD 2.6
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: befletch at my dot yahoo dot com
New email:
PHP Version: OS:

 

 [2000-03-07 16:13 UTC] befletch at my dot yahoo dot com
I can't get function arguments initalized to 'unset' to work anymore.
This example works fine:

  function myfunc( $arg=1 )
  {
    echo $arg."<br>\n";
  }

  myfunc( );
  myfunc( 'Hello, world.' );

Printing out '1' and 'Hello, world.' as expected.  Modify it to:

  function myfunc( $arg=unset )
  {
    echo $arg."<br>\n";
  }

  myfunc( );
  myfunc( 'Hello, world.' );

This version gives me:

  Parse error: parse error in /www/htdocs/test.html on line 7

where line 7 is the function myfunc() line.

This all worked fine with PHP4 betas 2 & 3.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-07 16:13 UTC] andrei at cvs dot php dot net
Use $arg = NULL.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 18:01:35 2025 UTC