<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >return</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Manual PHP" HREF="index.html"><LINK REL="UP" TITLE="Control Structures" HREF="language.control-structures.html"><LINK REL="PREVIOUS" TITLE="declare" HREF="control-structures.declare.html"><LINK REL="NEXT" TITLE="require" HREF="function.require.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-2"></HEAD ><BODY CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="control-structures.declare.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Cap. 11. Control Structures</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.require.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="function.return" >return</A ></H1 ><P > If called from within a function, the <A HREF="function.return.html" ><B CLASS="function" >return()</B ></A > statement immediately ends execution of the current function, and returns its argument as the value of the function call. <A HREF="function.return.html" ><B CLASS="function" >return()</B ></A > will also end the execution of an <A HREF="function.eval.html" ><B CLASS="function" >eval()</B ></A > statement or script file. </P ><P > If called from the global scope, then execution of the current script file is ended. If the current script file was <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A >ed or <A HREF="function.require.html" ><B CLASS="function" >require()</B ></A >ed, then control is passed back to the calling file. Furthermore, if the current script file was <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A >ed, then the value given to <A HREF="function.return.html" ><B CLASS="function" >return()</B ></A > will be returned as the value of the <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A > call. If <A HREF="function.return.html" ><B CLASS="function" >return()</B ></A > is called from within the main script file, then script execution ends. If the current script file was named by the <A HREF="ini.sect.data-handling.html#ini.auto-prepend-file" >auto_prepend_file</A > or <A HREF="ini.sect.data-handling.html#ini.auto-append-file" >auto_append_file</A > configuration options in <TT CLASS="filename" >php.ini</TT >, then that script file's execution is ended. </P ><P >For more information, see <A HREF="functions.returning-values.html" >Returning values</A >. </P ><P > <DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Notã: </B > Note that since <A HREF="function.return.html" ><B CLASS="function" >return()</B ></A > is a language construct and not a function, the parentheses surrounding its arguments are <SPAN CLASS="emphasis" ><I CLASS="emphasis" >only</I ></SPAN > required if the argument contains an expression. It is common to leave them out while returning a variable. </P ></BLOCKQUOTE ></DIV > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="control-structures.declare.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Acasã</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.require.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><VAR CLASS="literal" >declare</VAR ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="language.control-structures.html" ACCESSKEY="U" >Sus</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.require.html" ><B CLASS="function" >require()</B ></A ></TD ></TR ></TABLE ></DIV ></BODY ></HTML >