Connecting Tech Pros Worldwide Help | Site Map

function return values

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:10 AM
sinister
Guest
 
Posts: n/a
Default function return values

If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or is
this illegal?



  #2  
Old July 17th, 2005, 01:10 AM
Michael Fuhr
Guest
 
Posts: n/a
Default Re: function return values

"sinister" <sinister@nospam.invalid> writes:
[color=blue]
> If I assign a variable to a function, say,
> $x = f($y);
> and then f happens not to return anything, does $x just remain unset? Or is
> this illegal?[/color]

What happened when you tried it?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
  #3  
Old July 17th, 2005, 01:10 AM
sinister
Guest
 
Posts: n/a
Default Re: function return values


"Michael Fuhr" <mfuhr@fuhr.org> wrote in message
news:3fb8e3ed$1_2@omega.dimensional.com...[color=blue]
> "sinister" <sinister@nospam.invalid> writes:
>[color=green]
> > If I assign a variable to a function, say,
> > $x = f($y);
> > and then f happens not to return anything, does $x just remain unset?[/color][/color]
Or is[color=blue][color=green]
> > this illegal?[/color]
>
> What happened when you tried it?[/color]
<omission of laziness>Haven't.</omission of laziness>
[color=blue]
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/[/color]


  #4  
Old July 17th, 2005, 01:10 AM
sinister
Guest
 
Posts: n/a
Default Re: function return values


"sinister" <sinister@nospam.invalid> wrote in message
news:Bi6ub.52411$n6.36338@nwrddc03.gnilink.net...[color=blue]
>
> "Michael Fuhr" <mfuhr@fuhr.org> wrote in message
> news:3fb8e3ed$1_2@omega.dimensional.com...[color=green]
> > "sinister" <sinister@nospam.invalid> writes:
> >[color=darkred]
> > > If I assign a variable to a function, say,
> > > $x = f($y);
> > > and then f happens not to return anything, does $x just remain unset?[/color][/color]
> Or is[color=green][color=darkred]
> > > this illegal?[/color]
> >
> > What happened when you tried it?[/color]
> <omission of laziness>Haven't.</omission of laziness>[/color]

Of course, that should read <admission ...>

One reason I wanted to ask, not just test, is that I couldn't find the
answer in documentation, and there's always the danger that one
instantiation of the language will do it one way, and another another way.
[color=blue]
>[color=green]
> >
> > --
> > Michael Fuhr
> > http://www.fuhr.org/~mfuhr/[/color]
>
>[/color]


  #5  
Old July 17th, 2005, 01:10 AM
Michel
Guest
 
Posts: n/a
Default Re: function return values

No. $x would return NULL



"sinister" <sinister@nospam.invalid> wrote in message
news:mP4ub.52098$n6.1079@nwrddc03.gnilink.net...[color=blue]
> If I assign a variable to a function, say,
> $x = f($y);
> and then f happens not to return anything, does $x just remain unset? Or[/color]
is[color=blue]
> this illegal?
>
>[/color]


  #6  
Old July 17th, 2005, 01:12 AM
pouzzler
Guest
 
Posts: n/a
Default Re: function return values

Couldn't f() return NULL when it does not specifically returns something else?



"Michel" <please_no@spam.nl> wrote in message news:<bparsq$l8k$1@news.cistron.nl>...[color=blue]
> No. $x would return NULL
>
>
>
> "sinister" <sinister@nospam.invalid> wrote in message
> news:mP4ub.52098$n6.1079@nwrddc03.gnilink.net...[color=green]
> > If I assign a variable to a function, say,
> > $x = f($y);
> > and then f happens not to return anything, does $x just remain unset? Or[/color]
> is[color=green]
> > this illegal?
> >
> >[/color][/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.