On Mon, 1 Apr 2002, Jordan wrote:
> Isnt there really no need for the 'return' though?

Try this program and see what happens:

<?
   function triple1($x) { $x = $x * 3; return $x; }

   function triple2($x) { $x = $x * 3; }

   function triple3($x) { global $x; $x = $x * 3; }

   $x = 5; $x = triple1($x) print '<p>triple1: ' . $x;
   $x = 5; print '<p>triple1 return: ' . triple1($x);
   $x = 5; $x = triple2($x) print '<p>triple2: ' . $x;
   $x = 5; print '<p>triple2 return: ' . triple2($x);
   $x = 5; $x = triple3($x) print '<p>triple3: ' . $x;
   $x = 5; print '<p>triple3 return: ' . triple3($x);
?>

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to