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
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-07 16:13 UTC] andrei at cvs dot php dot net
Use $arg = NULL.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC