|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-28 13:16 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 19:00:01 2025 UTC |
Change if ($AnotherNumber <= 10000) { Calc($AnotherNumber); } to if ($AnotherNumber <= 10000) { return Calc($AnotherNumber); }