source.by

PHP: Writing Functions - Manual

Source 2020: https://www.php.net/manual/de/internals2.funcs.php | 2020-02-16

        <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="de">
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>PHP: Writing Functions - Manual </title>

 <link rel="shortcut icon" href="https://www.php.net/favicon.ico">
 <link rel="search" type="application/opensearchdescription+xml" href="http://php.net/phpnetimprovedsearch.src" title="Add PHP.net search">
 <link rel="alternate" type="application/atom+xml" href="https://www.php.net/releases/feed.php" title="PHP Release feed">
 <link rel="alternate" type="application/atom+xml" href="https://www.php.net/feed.atom" title="PHP: Hypertext Preprocessor">

 <link rel="canonical" href="https://www.php.net/manual/de/internals2.funcs.php">
 <link rel="shorturl" href="https://www.php.net/manual/de/internals2.funcs.php">
 <link rel="alternate" href="https://www.php.net/manual/de/internals2.funcs.php" hreflang="x-default">

 <link rel="contents" href="https://www.php.net/manual/de/index.php">
 <link rel="index" href="https://www.php.net/manual/de/internals2.php">
 <link rel="prev" href="https://www.php.net/manual/de/internals2.variables.objects.php">
 <link rel="next" href="https://www.php.net/manual/de/internals2.classes.php">

 <link rel="alternate" href="https://www.php.net/manual/en/internals2.funcs.php" hreflang="en">
 <link rel="alternate" href="https://www.php.net/manual/pt_BR/internals2.funcs.php" hreflang="pt_BR">
 <link rel="alternate" href="https://www.php.net/manual/zh/internals2.funcs.php" hreflang="zh">
 <link rel="alternate" href="https://www.php.net/manual/fr/internals2.funcs.php" hreflang="fr">
 <link rel="alternate" href="https://www.php.net/manual/de/internals2.funcs.php" hreflang="de">
 <link rel="alternate" href="https://www.php.net/manual/ja/internals2.funcs.php" hreflang="ja">
 <link rel="alternate" href="https://www.php.net/manual/ro/internals2.funcs.php" hreflang="ro">
 <link rel="alternate" href="https://www.php.net/manual/ru/internals2.funcs.php" hreflang="ru">
 <link rel="alternate" href="https://www.php.net/manual/es/internals2.funcs.php" hreflang="es">
 <link rel="alternate" href="https://www.php.net/manual/tr/internals2.funcs.php" hreflang="tr">

<link rel="stylesheet" type="text/css" href="/cached.php?t=1539771603&f=/fonts/Fira/fira.css" media="screen">
<link rel="stylesheet" type="text/css" href="/cached.php?t=1539765004&f=/fonts/Font-Awesome/css/fontello.css" media="screen">
<link rel="stylesheet" type="text/css" href="/cached.php?t=1540425603&f=/styles/theme-base.css" media="screen">
<link rel="stylesheet" type="text/css" href="/cached.php?t=1540425603&f=/styles/theme-medium.css" media="screen">

 <!--[if lte IE 7]>
 <link rel="stylesheet" type="text/css" href="https://www.php.net/styles/workarounds.ie7.css" media="screen">
 <![endif]-->

 <!--[if lte IE 8]>
 <script>
  window.brokenIE = true;
 </script>
 <![endif]-->

 <!--[if lte IE 9]>
 <link rel="stylesheet" type="text/css" href="https://www.php.net/styles/workarounds.ie9.css" media="screen">
 <![endif]-->

 <!--[if IE]>
 <script src="https://www.php.net/js/ext/html5.js"></script>
 <![endif]-->

 <base href="https://www.php.net/manual/de/internals2.funcs.php">

</head>
<body class="docs ">

<nav id="head-nav" class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <a href="/" class="brand"><img src="/images/logos/php-logo.svg" width="48" height="24" alt="php"></a>
    <div id="mainmenu-toggle-overlay"></div>
    <input type="checkbox" id="mainmenu-toggle">
    <ul class="nav">
      <li class=""><a href="/downloads">Downloads</a></li>
      <li class="active"><a href="/docs.php">Documentation</a></li>
      <li class=""><a href="/get-involved" >Get Involved</a></li>
      <li class=""><a href="/support">Help</a></li>
    </ul>
    <form class="navbar-search" id="topsearch" action="/search.php">
      <input type="hidden" name="show" value="quickref">
      <input type="search" name="pattern" class="search-query" placeholder="Search" accesskey="s">
    </form>
  </div>
  <div id="flash-message"></div>
</nav>
<div class="headsup"><a href='/index.php#id2020-02-20-2'>PHP 7.3.15 Released</a></div>
<nav id="trick"><div><dl>
<dt><a href='/manual/en/getting-started.php'>Getting Started</a></dt>
	<dd><a href='/manual/en/introduction.php'>Introduction</a></dd>
	<dd><a href='/manual/en/tutorial.php'>A simple tutorial</a></dd>
<dt><a href='/manual/en/langref.php'>Language Reference</a></dt>
	<dd><a href='/manual/en/language.basic-syntax.php'>Basic syntax</a></dd>
	<dd><a href='/manual/en/language.types.php'>Types</a></dd>
	<dd><a href='/manual/en/language.variables.php'>Variables</a></dd>
	<dd><a href='/manual/en/language.constants.php'>Constants</a></dd>
	<dd><a href='/manual/en/language.expressions.php'>Expressions</a></dd>
	<dd><a href='/manual/en/language.operators.php'>Operators</a></dd>
	<dd><a href='/manual/en/language.control-structures.php'>Control Structures</a></dd>
	<dd><a href='/manual/en/language.functions.php'>Functions</a></dd>
	<dd><a href='/manual/en/language.oop5.php'>Classes and Objects</a></dd>
	<dd><a href='/manual/en/language.namespaces.php'>Namespaces</a></dd>
	<dd><a href='/manual/en/language.errors.php'>Errors</a></dd>
	<dd><a href='/manual/en/language.exceptions.php'>Exceptions</a></dd>
	<dd><a href='/manual/en/language.generators.php'>Generators</a></dd>
	<dd><a href='/manual/en/language.references.php'>References Explained</a></dd>
	<dd><a href='/manual/en/reserved.variables.php'>Predefined Variables</a></dd>
	<dd><a href='/manual/en/reserved.exceptions.php'>Predefined Exceptions</a></dd>
	<dd><a href='/manual/en/reserved.interfaces.php'>Predefined Interfaces and Classes</a></dd>
	<dd><a href='/manual/en/context.php'>Context options and parameters</a></dd>
	<dd><a href='/manual/en/wrappers.php'>Supported Protocols and Wrappers</a></dd>
</dl>
<dl>
<dt><a href='/manual/en/security.php'>Security</a></dt>
	<dd><a href='/manual/en/security.intro.php'>Introduction</a></dd>
	<dd><a href='/manual/en/security.general.php'>General considerations</a></dd>
	<dd><a href='/manual/en/security.cgi-bin.php'>Installed as CGI binary</a></dd>
	<dd><a href='/manual/en/security.apache.php'>Installed as an Apache module</a></dd>
	<dd><a href='/manual/en/security.sessions.php'>Session Security</a></dd>
	<dd><a href='/manual/en/security.filesystem.php'>Filesystem Security</a></dd>
	<dd><a href='/manual/en/security.database.php'>Database Security</a></dd>
	<dd><a href='/manual/en/security.errors.php'>Error Reporting</a></dd>
	<dd><a href='/manual/en/security.globals.php'>Using Register Globals</a></dd>
	<dd><a href='/manual/en/security.variables.php'>User Submitted Data</a></dd>
	<dd><a href='/manual/en/security.magicquotes.php'>Magic Quotes</a></dd>
	<dd><a href='/manual/en/security.hiding.php'>Hiding PHP</a></dd>
	<dd><a href='/manual/en/security.current.php'>Keeping Current</a></dd>
<dt><a href='/manual/en/features.php'>Features</a></dt>
	<dd><a href='/manual/en/features.http-auth.php'>HTTP authentication with PHP</a></dd>
	<dd><a href='/manual/en/features.cookies.php'>Cookies</a></dd>
	<dd><a href='/manual/en/features.sessions.php'>Sessions</a></dd>
	<dd><a href='/manual/en/features.xforms.php'>Dealing with XForms</a></dd>
	<dd><a href='/manual/en/features.file-upload.php'>Handling file uploads</a></dd>
	<dd><a href='/manual/en/features.remote-files.php'>Using remote files</a></dd>
	<dd><a href='/manual/en/features.connection-handling.php'>Connection handling</a></dd>
	<dd><a href='/manual/en/features.persistent-connections.php'>Persistent Database Connections</a></dd>
	<dd><a href='/manual/en/features.safe-mode.php'>Safe Mode</a></dd>
	<dd><a href='/manual/en/features.commandline.php'>Command line usage</a></dd>
	<dd><a href='/manual/en/features.gc.php'>Garbage Collection</a></dd>
	<dd><a href='/manual/en/features.dtrace.php'>DTrace Dynamic Tracing</a></dd>
</dl>
<dl>
<dt><a href='/manual/en/funcref.php'>Function Reference</a></dt>
	<dd><a href='/manual/en/refs.basic.php.php'>Affecting PHP's Behaviour</a></dd>
	<dd><a href='/manual/en/refs.utilspec.audio.php'>Audio Formats Manipulation</a></dd>
	<dd><a href='/manual/en/refs.remote.auth.php'>Authentication Services</a></dd>
	<dd><a href='/manual/en/refs.utilspec.cmdline.php'>Command Line Specific Extensions</a></dd>
	<dd><a href='/manual/en/refs.compression.php'>Compression and Archive Extensions</a></dd>
	<dd><a href='/manual/en/refs.creditcard.php'>Credit Card Processing</a></dd>
	<dd><a href='/manual/en/refs.crypto.php'>Cryptography Extensions</a></dd>
	<dd><a href='/manual/en/refs.database.php'>Database Extensions</a></dd>
	<dd><a href='/manual/en/refs.calendar.php'>Date and Time Related Extensions</a></dd>
	<dd><a href='/manual/en/refs.fileprocess.file.php'>File System Related Extensions</a></dd>
	<dd><a href='/manual/en/refs.international.php'>Human Language and Character Encoding Support</a></dd>
	<dd><a href='/manual/en/refs.utilspec.image.php'>Image Processing and Generation</a></dd>
	<dd><a href='/manual/en/refs.remote.mail.php'>Mail Related Extensions</a></dd>
	<dd><a href='/manual/en/refs.math.php'>Mathematical Extensions</a></dd>
	<dd><a href='/manual/en/refs.utilspec.nontext.php'>Non-Text MIME Output</a></dd>
	<dd><a href='/manual/en/refs.fileprocess.process.php'>Process Control Extensions</a></dd>
	<dd><a href='/manual/en/refs.basic.other.php'>Other Basic Extensions</a></dd>
	<dd><a href='/manual/en/refs.remote.other.php'>Other Services</a></dd>
	<dd><a href='/manual/en/refs.search.php'>Search Engine Extensions</a></dd>
	<dd><a href='/manual/en/refs.utilspec.server.php'>Server Specific Extensions</a></dd>
	<dd><a href='/manual/en/refs.basic.session.php'>Session Extensions</a></dd>
	<dd><a href='/manual/en/refs.basic.text.php'>Text Processing</a></dd>
	<dd><a href='/manual/en/refs.basic.vartype.php'>Variable and Type Related Extensions</a></dd>
	<dd><a href='/manual/en/refs.webservice.php'>Web Services</a></dd>
	<dd><a href='/manual/en/refs.utilspec.windows.php'>Windows Only Extensions</a></dd>
	<dd><a href='/manual/en/refs.xml.php'>XML Manipulation</a></dd>
	<dd><a href='/manual/en/refs.ui.php'>GUI Extensions</a></dd>
</dl>
<dl>
<dt>Keyboard Shortcuts</dt><dt>?</dt>
<dd>This help</dd>
<dt>j</dt>
<dd>Next menu item</dd>
<dt>k</dt>
<dd>Previous menu item</dd>
<dt>g p</dt>
<dd>Previous man page</dd>
<dt>g n</dt>
<dd>Next man page</dd>
<dt>G</dt>
<dd>Scroll to bottom</dd>
<dt>g g</dt>
<dd>Scroll to top</dd>
<dt>g h</dt>
<dd>Goto homepage</dd>
<dt>g s</dt>
<dd>Goto search<br>(current page)</dd>
<dt>/</dt>
<dd>Focus search box</dd>
</dl></div></nav>
<div id="goto">
    <div class="search">
         <div class="text"></div>
         <div class="results"><ul></ul></div>
   </div>
</div>

  <div id="breadcrumbs" class="clearfix">
    <div id="breadcrumbs-inner">
          <div class="next">
        <a href="internals2.classes.php">
          Writing Classes »
        </a>
      </div>
              <div class="prev">
        <a href="internals2.variables.objects.php">
          « Working with Objects        </a>
      </div>
          <ul>
            <li><a href='index.php'>PHP-Handbuch</a></li>      <li><a href='internals2.php'>PHP im Kern: Das Entwicklerhandbuch für die Zend Engine</a></li>      </ul>
    </div>
  </div>




<div id="layout" class="clearfix">
  <section id="layout-content">
  <div class="page-tools">
    <div class="change-language">
      <form action="/manual/change.php" method="get" id="changelang" name="changelang">
        <fieldset>
          <label for="changelang-langs">Change language:</label>
          <select onchange="document.changelang.submit()" name="page" id="changelang-langs">
            <option value='en/internals2.funcs.php'>English</option>
            <option value='pt_BR/internals2.funcs.php'>Brazilian Portuguese</option>
            <option value='zh/internals2.funcs.php'>Chinese (Simplified)</option>
            <option value='fr/internals2.funcs.php'>French</option>
            <option value='de/internals2.funcs.php' selected="selected">German</option>
            <option value='ja/internals2.funcs.php'>Japanese</option>
            <option value='ro/internals2.funcs.php'>Romanian</option>
            <option value='ru/internals2.funcs.php'>Russian</option>
            <option value='es/internals2.funcs.php'>Spanish</option>
            <option value='tr/internals2.funcs.php'>Turkish</option>
            <option value="help-translate.php">Other</option>
          </select>
        </fieldset>
      </form>
    </div>
    <div class="edit-bug">
      <a href="https://edit.php.net/?project=PHP&perm=de/internals2.funcs.php">Edit</a>
      <a href="https://bugs.php.net/report.php?bug_type=Documentation+problem&manpage=internals2.funcs">Report a Bug</a>
    </div>
  </div><div id="internals2.funcs" class="chapter">
  <h1>Writing Functions</h1>

  <p class="para">
   Functions and Methods in PHP take much the same form, a method is simply a function with a specific scope; the scope of their class entry.
   The <code class="code">Hacker</code> will read about class entries in other sections of the <code class="code">Hacker's</code> guide.
   The purpose of this section is to introduce the <code class="code">Hacker</code> to the anatomy of a function or method; 
   the <code class="code">Hacker</code> will learn how to define functions, how to accept variables and how to return variables to the programmer of PHP.
  </p>

  <p class="para">
   The anatomy of a function could not be simpler:
  </p>
  
  <div class="example-contents screen">
<div class="cdata"><pre>
PHP_FUNCTION(hackers_function) {
  /* your accepted arguments here */
  long number;
  
  /* accepting arguments */
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &number) != SUCCESS) {
      return;
  }
  
  /* do some work on the input */
  number *= 2;
  
  /* set return value */
  RETURN_LONG(number);
}</pre></div>
  </div>
  
  <p class="para">
   The <code class="code">PHP_FUNCTION(hackers_function)</code> preprocessor instruction will result in the following declaration:
  </p>
  
  <div class="example-contents screen">
<div class="cdata"><pre>
void zif_hackers_function(INTERNAL_FUNCTION_PARAMETERS)
</pre></div>
  </div>
  
  <p class="para">
   <code class="code">INTERNAL_FUNCTION_PARAMETERS</code> is defined as a macro and explained in the following table:
  </p>
  
  <table id="internals2.funcs.index.internal-func-params" class="doctable table">
   <caption><strong>INTERNAL_FUNCTION_PARAMETERS</strong></caption>
   
    <thead>
     <tr>
      <th>Name and type</th>
      <th>Description</th>
      <th>Access macros</th>
     </tr>

    </thead>

    <tbody class="tbody">
                                                    
     <tr>
      <td><code class="code">int ht</code></td>
      <td>Number of actual parameters passed by user</td>
      <td><code class="code">ZEND_NUM_ARGS()</code></td>
     </tr>


     <tr>
      <td><code class="code">zval *return_value</code></td>
      <td>
       Pointer to a PHP variable that can be filled with the return value
       passed to the user. The default type is <code class="code">IS_NULL</code>.
      </td>
      <td><code class="code">RETVAL_*</code>, <code class="code">RETURN_*</code></td>
     </tr>


     <tr>
      <td><code class="code">zval **return_value_ptr</code></td>
      <td>When returning references to PHP set this to a pointer to
       your variable. It is not suggested to return references.</td>
      <td class="empty"> </td>
     </tr>


     <tr>
      <td><code class="code">zval *this_ptr</code></td>
      <td>
       If this is a method call, points to the PHP variable
       holding the <code class="code">$this</code> object.
      </td>
      <td><code class="code">getThis()</code></td>
     </tr>


     <tr>
      <td><code class="code">int return_value_used</code></td>
      <td>
       Flag indicating whether the returned value will be used by the
       caller.
      </td>
      <td class="empty"> </td>
     </tr>


    </tbody>
   
  </table>

  
  <p class="para">
   For clarity, the fully expanded declaration for <code class="code">PHP_FUNCTION(hackers_function)</code> looks like:
  </p>
  
  <div class="example-contents screen">
<div class="cdata"><pre>
void zif_hackers_function(int ht, zval* return_value, zval** return_value_ptr, zval* this_ptr, int return_value_used)
</pre></div>
  </div>
  
  <p class="para">
    The presence of <code class="code">this_ptr</code> may be confusing, classes are covered in detail in later sections, 
    suffice to say that <code class="code">PHP_METHOD(MyClass, hackersFunction)</code> would result in the following declaration:
  </p>
  
  <div class="example-contents screen">
<div class="cdata"><pre>
void zim_MyClass_hackersFunction(INTERNAL_FUNCTION_PARAMETERS)
</pre></div>
  </div>
  
  <p class="para">
   <code class="code">hackers_function</code> doesn't do anything useful, it accepts a number using the <code class="code">zend_parse_parameters</code> API, doubles it, and returns it to the engine.
   It is obvious that a normal function would have to do something more complex than double the input, for the purposes of education we are keeping it simple. 
   On entry to the function <code class="code">return_value</code> is allocated and initialized to <code class="code">null</code>, making <code class="code">null</code> the default return value of any function in PHP.
  </p>
  
  <p class="para">
   If <code class="code">zend_parse_parameters</code> does not recieve what is specified by the <code class="code">Hacker</code> as the correct arguments, and the arguments recieved cannot be converted
   to conform with <code class="code">type_spec</code> an error will be raised, and by convention, the <code class="code">Hacker</code> should <code class="code">return</code> immediately.
  </p>
  
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para"><code class="code">Arrays</code>, <code class="code">Objects</code>, and <code class="code">Resources</code> cannot be converted.</p>
  </p></blockquote>
  
  <table id="internals2.funcs.parameters.api" class="doctable table">
   <caption><strong>Parsing Parameters Prototypes</strong></caption>
   
    <tbody class="tbody">
     <tr>
      <td><code class="code">int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)</code></td>
     </tr>

     <tr>
      <td><code class="code">int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...)</code></td>
     </tr>

     <tr>
      <td><code class="code">int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...)</code></td>
     </tr>

    </tbody>
   
  </table>

  
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    <code class="code">zend_parse_parameter</code> is available from version 5.5, it behaves like <code class="code">zend_parse_parameters_ex</code> 
    except that instead of reading the arguments from the stack, it receives a single zval to convert, which may be changed in place.
   </p>
  </p></blockquote>
  
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    <code class="code">flags</code> is intended to be a mask, currently only <code class="code">ZEND_PARSE_PARAMS_QUIET</code> will have any impact (supress warnings)
   </p>
  </p></blockquote>
  
  <p class="para">
   The variable arguments recieved by these API functions are expected to be the address of C variables, and should be considered the output of the <code class="code">zend_parse_parameters</code> API functions.
  </p>

  <table id="internals2.funcs.parameters.types" class="doctable table">
   <caption><strong>Type Specifiers</strong></caption>
   
     <thead>
     <tr>
      <th>Spec</th>
      <th>Type</th>
      <th>Locals</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>a</td>
      <td><code class="code">array</code></td>
      <td><code class="code">zval*</code></td>
     </tr>

     <tr>
      <td>A</td>
      <td><code class="code">array</code> or <code class="code">object</code></td>
      <td><code class="code">zval*</code></td>
     </tr>

     <tr>
      <td>b</td>
      <td><code class="code">boolean</code></td>
      <td><code class="code">zend_bool</code></td>
     </tr>

     <tr>
      <td>C</td>
      <td><code class="code">class</code></td>
      <td><code class="code">zend_class_entry*</code></td>
     </tr>

     <tr>
      <td>d</td>
      <td><code class="code">double</code></td>
      <td><code class="code">double</code></td>
     </tr>

     <tr>
      <td>f</td>
      <td><code class="code">function</code></td>
      <td><code class="code">zend_fcall_info*</code>, <code class="code">zend_fcall_info_cache*</code></td>
     </tr>

     <tr>
      <td>h</td>
      <td><code class="code">array</code></td>
      <td><code class="code">HashTable*</code></td>
     </tr>

     <tr>
      <td>H</td>
      <td><code class="code">array</code> or <code class="code">object</code></td>
      <td><code class="code">HashTable*</code></td>
     </tr>

     <tr>
      <td>l</td>
      <td><code class="code">long</code></td>
      <td><code class="code">long</code></td>
     </tr>

     <tr>
      <td>L</td>
      <td><code class="code">long</code> (limits out-of-range LONG_MAX/LONG_MIN)</td>
      <td><code class="code">long</code></td>
     </tr>

     <tr>
      <td>o</td>
      <td><code class="code">object</code></td>
      <td><code class="code">zval*</code></td>
     </tr>

     <tr>
      <td>O</td>
      <td><code class="code">object</code> (of specified <code class="code">zend_class_entry</code>)</td>
      <td><code class="code">zval*</code>, <code class="code">zend_class_entry*</code></td>
     </tr>

     <tr>
      <td>p</td>
      <td><code class="code">string</code> (a valid path)</td>
      <td><code class="code">char*</code>, <code class="code">int</code></td>
     </tr>

     <tr>
      <td>r</td>
      <td><code class="code">resource</code></td>
      <td><code class="code">zval*</code></td>
     </tr>

     <tr>
      <td>s</td>
      <td><code class="code">string</code></td>
      <td><code class="code">char*</code>, <code class="code">int</code></td>
     </tr>

     <tr>
      <td>z</td>
      <td><code class="code">mixed</code></td>
      <td><code class="code">zval*</code></td>
     </tr>

     <tr>
      <td>Z</td>
      <td><code class="code">mixed</code></td>
      <td><code class="code">zval**</code></td>
     </tr>

    </tbody>
   
  </table>

  
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Where the type specifier is <code class="code">O</code>, the local <code class="code">zend_class_entry*</code> is to be 
    considered input (part of the type spec) to <code class="code">zend_parse_parameter</code>
   </p>
  </p></blockquote>
  
  <table id="internals2.funcs.parameters.advanced" class="doctable table">
   <caption><strong>Advanced Type Specifiers</strong></caption>
   
     <thead>
     <tr>
      <th>Spec</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>*</td>
      <td>a variable number of argument of the preceeding type, 0 or more</td>
     </tr>

     <tr>
      <td>+</td>
      <td>a variable number of argument of the preceeding type, 1 or more</td>
     </tr>

     <tr>
      <td>|</td>
      <td>indicates that the remaining parameters are optional</td>
     </tr>

     <tr>
      <td>/</td>
      <td><code class="code">SEPARATE_ZVAL_IF_NOT_REF</code> on the parameter it follows</td>
     </tr>

     <tr>
      <td>!</td>
      <td>
       the preceeding parameter can be of the specified type or <code class="code">null</code>
       For 'b', 'l' and 'd', an extra argument of type zend_bool* must be passed after 
       the corresponding <code class="code">bool*</code>, <code class="code">long*</code> or <code class="code">double*</code> 
       addresses which will be set <code class="code">true</code> if <code class="code">null</code> is recieved.
      </td>
     </tr>

    </tbody>
   
  </table>

  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">Consult <code class="code">README.PARAMETER_PARSING_API</code> included in source distributions for more information on parsing parameters</p>
  </p></blockquote>
  
  <p class="para">
   Once the <code class="code">Hacker's</code> function has executed whatever it was implemented to execute, it is time to set the <code class="code">return_value</code> for the engine. 
   The <code class="code">RETURN_</code> and <code class="code">RETVAL_</code> macros are just wrappers around <code class="code">Z_*_P</code> macros that work with <code class="code">return_value</code>. 
  </p>
  
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para"><code class="code">RETURN_</code> macros cause execution to leave the function immediately (ie: <code class="code">return;</code>), while <code class="code">RETVAL_</code> macros allow execution to continue after <code class="code">return_value</code> has been set.</p>
  </p></blockquote>
  
  <p class="para">
   The <code class="code">Hacker</code> should now have a reasonable understanding of the anatomy of a function, and to some degree, the anatomy of a method.
  </p>

</div>

<section id="usernotes">
 <div class="head">
  <span class="action"><a href="/manual/add-note.php?sect=internals2.funcs&redirect=https://www.php.net/manual/de/internals2.funcs.php"><img src='/images/notes-add@2x.png' alt='add a note' width='12' height='12'> <small>add a note</small></a></span>
  <h3 class="title">User Contributed Notes <span class="count">1 note</span></h3>
 </div><div id="allnotes">
  <div class="note" id="124176">  <div class="votes">
    <div id="Vu124176">
    <a href="/manual/vote-note.php?id=124176&page=internals2.funcs&vote=up" title="Vote up!" class="usernotes-voteu">up</a>
    </div>
    <div id="Vd124176">
    <a href="/manual/vote-note.php?id=124176&page=internals2.funcs&vote=down" title="Vote down!" class="usernotes-voted">down</a>
    </div>
    <div class="tally" id="V124176" title="83% like this...">
    4
    </div>
  </div>
  <a href="#124176" class="name">
  <strong class="user"><em>ka5 at ua dot fm</em></strong></a><a class="genanchor" href="#124176"> ¶</a><div class="date" title="2019-09-05 08:54"><strong>5 months ago</strong></div>
  <div class="text" id="Hcom124176">
<div class="phpcode"><code><span class="html">
The 'l' spec expects a parameter of the type zend_long, not long anymore.<br />The 's' spec expects parameters of the type char * and size_t, no int anymore.<br />(c) <a href="https://github.com/php/php-src/blob/PHP-7.0.0/UPGRADING.INTERNALS#L75" rel="nofollow" target="_blank">https://github.com/php/php-src/blob/PHP-7.0.0/UPGRADING.INTERNALS#L75</a></span>
</code></div>
  </div>
 </div></div>

 <div class="foot"><a href="/manual/add-note.php?sect=internals2.funcs&redirect=https://www.php.net/manual/de/internals2.funcs.php"><img src='/images/notes-add@2x.png' alt='add a note' width='12' height='12'> <small>add a note</small></a></div>
</section>    </section><!-- layout-content -->
        <aside class='layout-menu'>

        <ul class='parent-menu-list'>
                                    <li>
                <a href="internals2.php">PHP im Kern: Das Entwicklerhandbuch für die Zend Engine</a>

                                    <ul class='child-menu-list'>

                                                <li class="">
                            <a href="internals2.preface.php" title="Preface">Preface</a>
                        </li>
                                                <li class="">
                            <a href="internals2.memory.php" title="Memory management">Memory management</a>
                        </li>
                                                <li class="">
                            <a href="internals2.variables.php" title="Working with Variables">Working with Variables</a>
                        </li>
                                                <li class="current">
                            <a href="internals2.funcs.php" title="Writing Functions">Writing Functions</a>
                        </li>
                                                <li class="">
                            <a href="internals2.classes.php" title="Writing Classes">Writing Classes</a>
                        </li>
                                                <li class="">
                            <a href="internals2.resources.php" title="Working with Resources">Working with Resources</a>
                        </li>
                                                <li class="">
                            <a href="internals2.ini.php" title="Working with INI settings">Working with INI settings</a>
                        </li>
                                                <li class="">
                            <a href="internals2.streams.php" title="Working with streams">Working with streams</a>
                        </li>
                                                <li class="">
                            <a href="internals2.counter.php" title="The "counter" Extension -​ A Continuing Example">The "counter" Extension -​ A Continuing Example</a>
                        </li>
                                                <li class="">
                            <a href="internals2.buildsys.php" title="The PHP 5 build system">The PHP 5 build system</a>
                        </li>
                                                <li class="">
                            <a href="internals2.structure.php" title="Extension structure">Extension structure</a>
                        </li>
                                                <li class="">
                            <a href="internals2.pdo.php" title="PDO Driver How-​To">PDO Driver How-​To</a>
                        </li>
                                                <li class="">
                            <a href="internals2.faq.php" title="Extension FAQs">Extension FAQs</a>
                        </li>
                                                <li class="">
                            <a href="internals2.apiref.php" title="Zend Engine 2 API reference">Zend Engine 2 API reference</a>
                        </li>
                                                <li class="">
                            <a href="internals2.opcodes.php" title="Zend Engine 2 Opcodes">Zend Engine 2 Opcodes</a>
                        </li>
                                                <li class="">
                            <a href="internals2.ze1.php" title="Zend Engine 1">Zend Engine 1</a>
                        </li>
                        
                    </ul>
                
            </li>
                        
                    </ul>
    </aside>


  </div><!-- layout -->

  <footer>
    <div class="container footer-content">
      <div class="row-fluid">
      <ul class="footmenu">
        <li><a href="/copyright.php">Copyright © 2001-2020 The PHP Group</a></li>
        <li><a href="/my.php">My PHP.net</a></li>
        <li><a href="/contact.php">Contact</a></li>
        <li><a href="/sites.php">Other PHP.net sites</a></li>
        <li><a href="/privacy.php">Privacy policy</a></li>
      </ul>
      </div>
    </div>
  </footer>

    
 <!-- External and third party libraries. -->
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="/cached.php?t=1421837618&f=/js/ext/modernizr.js"></script>
<script src="/cached.php?t=1421837618&f=/js/ext/hogan-2.0.0.min.js"></script>
<script src="/cached.php?t=1421837618&f=/js/ext/typeahead.min.js"></script>
<script src="/cached.php?t=1421837618&f=/js/ext/mousetrap.min.js"></script>
<script src="/cached.php?t=1421837618&f=/js/search.js"></script>
<script src="/cached.php?t=1539765004&f=/js/common.js"></script>

<a id="toTop" href="javascript:;"><span id="toTopHover"></span><img width="40" height="40" alt="To Top" src="/images/to-top@2x.png"></a>

</body>
</html>

HEADER-CODE:


HTTP/1.1 200 OK
Server: myracloud
Date: Wed, 06 May 2020 21:09:03 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Content-language: en
X-Frame-Options: SAMEORIGIN
Set-Cookie: LAST_LANG=de; expires=Thu, 06-May-2021 21:09:03 GMT; Max-Age=31536000; path=/; domain=.php.net
Set-Cookie: COUNTRY=NA%2C185.85.3.195; expires=Wed, 13-May-2020 21:09:03 GMT; Max-Age=604800; path=/; domain=.php.net
Link: ; rel=shorturl
Last-Modified: Wed, 06 May 2020 04:19:19 GMT
Expires: Wed, 06 May 2020 21:09:03 GMT
Cache-Control: max-age=0

IP 185.85.0.29 www.php.net

Website:www.php.net
IP:185.85.0.29
County:DE Germany
Region:BY Bavaria
City:80331 Munich
Timezone:Europe/Berlin
html
html5
CSS
CSS3
CSS GRID
Java
EROPA - What does EROPA stand for? The Free Dictionary | UserPages · Wiki · Mutt Project / mutt · GitLab | https://uses.plantnet-project.org/en/Aleurites_moluccana_%28PROSEA%29 | 301 Moved Permanently | Connie Sellecca – Wikipedia | Stiftung | Kulturstiftung des Bundes | Begge Peder Tickets - alle Termine auf einen Blick - Karten online bestellen - Reservix - dein Ticketportal | https://en.wikipedia.org/wiki/2020_coronavirus_pandemic_in_Belarus | https://entfernen-von-spyware.blogspot.com/2020/06/losung-fur-entfernen-searchtopic.html | SecurCare Self Storage | Find Safe & Secure Self Storage Near You | Redbubble logo | Welcome To The Documents Library | https://www2.cs.arizona.edu/classes/cs210/fall17/sections/MyQueue.java | https://www.facebook.com/ExperiencePlastipak/ | J. Mark Erbaugh, Ph.D. | International Programs in Agriculture | Eunomius | Greek bishop | Britannica