php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39424 Function Arguments
Submitted: 2006-11-08 07:29 UTC Modified: 2006-11-08 10:37 UTC
From: mojtaba2005sh at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.0 OS: Windows and Linux
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: mojtaba2005sh at gmail dot com
New email:
PHP Version: OS:

 

 [2006-11-08 07:29 UTC] mojtaba2005sh at gmail dot com
Description:
------------
When I want to set a default value for a funcion and set the default value with for example 'rand(1,100)' or a class variable like '$this->m' it gives a syntax error
this was the error:
syntax error, unexpected '(', expecting ')' 

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

function test($m=rand(1,100)){
	echo $m;
}
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-08 10:37 UTC] bjori@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 22:01:27 2024 UTC