ID:               36889
 User updated by:  webmaster at solocreation dot com
 Reported By:      webmaster at solocreation dot com
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Debian Sarge
 PHP Version:      4.4.2
 New Comment:

OMG.. shame on me, sorry


Previous Comments:
------------------------------------------------------------------------

[2006-03-28 13:34:12] [EMAIL PROTECTED]

Change 

if ($AnotherNumber <= 10000) {
Calc($AnotherNumber);
}

to

if ($AnotherNumber <= 10000) {
return Calc($AnotherNumber);
}

------------------------------------------------------------------------

[2006-03-28 13:16:09] webmaster at solocreation dot com

Description:
------------
with sample code, output is :
$AnotherNumber=200000
NULL

so variable is set and correct, but return always assign NULL to $Test

if it's not a  bug, I'd like to know what I'm doing wrong ??

Reproduce code:
---------------
<?php
Function Multipl($Number) {
return $Number*100;
}


Function Calc ($AnotherNumber) {

$AnotherNumber = Multipl($AnotherNumber);

if ($AnotherNumber <= 10000) {
Calc($AnotherNumber);
}
else {
echo '$AnotherNumber='.$AnotherNumber.'<br />';
return $AnotherNumber;
}
}

$Test = Calc(20);
var_dump($Test);
?>

Expected result:
----------------
$AnotherNumber=200000
200000

Actual result:
--------------
$AnotherNumber=200000
NULL


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36889&edit=1

Reply via email to