php-doc-en/reference/runkit/functions/runkit-function-redefine.xml
Christoph Michael Becker 5a389c052c Fix #73661: Closure support not mentioned
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341329 c90b9560-bf6c-de11-be94-00142212c4b1
2016-12-07 15:36:56 +00:00

185 lines
4.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
<refentry xml:id="function.runkit-function-redefine" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>runkit_function_redefine</refname>
<refpurpose>
Replace a function definition with a new implementation
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>runkit_function_redefine</methodname>
<methodparam><type>string</type><parameter>funcname</parameter></methodparam>
<methodparam><type>string</type><parameter>arglist</parameter></methodparam>
<methodparam><type>string</type><parameter>code</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>return_by_reference</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>doc_comment</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>bool</type><methodname>runkit_function_redefine</methodname>
<methodparam><type>string</type><parameter>funcname</parameter></methodparam>
<methodparam><type>Closure</type><parameter>closure</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>doc_comment</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
&note.runkit.internal-override;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>funcname</parameter></term>
<listitem>
<para>
Name of function to redefine
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>arglist</parameter></term>
<listitem>
<para>
New list of arguments to be accepted by function
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>code</parameter></term>
<listitem>
<para>
New code implementation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>closure</parameter></term>
<listitem>
<para>
A <classname>closure</classname> that defines the function.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>return_by_reference</parameter></term>
<listitem>
<para>
Whether the function should return by reference.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>doc_comment</parameter></term>
<listitem>
<para>
The doc comment of the function.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>runkit 1.0.4</entry>
<entry>
An alternative syntax expecting a <parameter>closure</parameter> has been added.
</entry>
</row>
<row>
<entry>runkit 1.0.4</entry>
<entry>
The optional parameters <parameter>return_by_reference</parameter> and
<parameter>doc_comment</parameter> have been added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>runkit_function_redefine</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
function testme() {
echo "Original Testme Implementation\n";
}
testme();
runkit_function_redefine('testme','','echo "New Testme Implementation\n";');
testme();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Original Testme Implementation
New Testme Implementation
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>runkit_function_add</function></member>
<member><function>runkit_function_copy</function></member>
<member><function>runkit_function_rename</function></member>
<member><function>runkit_function_remove</function></member>
<member><function>runkit_method_redefine</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->