You'd have to show the processing in getDomain for anybody to guess...

Which values of $SERVER_NAME make it crash?...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Doug Farmer <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 5:26 PM
Subject: scoping: can someone explain to me if this should/should not work?


> The following code seems to work in general but everyone once in a while
I'm
> getting a segmentation fault.  Can someone explain to me why this would be
> intermittent and/or whether or not it should work?
>
> function getDomain($serverName)
> {
>      $result = $serverName;
>      // some processing to result occurs here
>      echo "here 3: $result<br>";
>      return $result;
> }
>
> function test()
> {
>     global $SERVER_NAME;
>     echo "here 1<br>";
>     $domain = getDomain($SERVER_NAME);
>     echo "here 2<br>";
>
> }
>
> When I get a segv, I get the output:
>
> here 1
> here 3: <appropriate value here>
>
> The "here 2" is not displayed.  I thought that this would a return by copy
> and not have an issue.
>
> - doug
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to