Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion language/predefined/fiber/throw.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 8fee3ae9715ffa15922469eb7d98f4878917a6ee Maintainer: pierrick Status: ready -->
<!-- EN-Revision: b3a0b9924ba577a3abf246c1bd1a6cf5c4bf14dc Maintainer: lacatoire Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="fiber.throw" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand Down Expand Up @@ -43,6 +43,40 @@
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<informalexample>
<programlisting role="php">
<![CDATA[
<?php

$fiber = new Fiber(function () {
try {
// Suspend l'exécution de la fibre en déclarant un point d'interruption
Fiber::suspend();
} catch (Throwable $e) {
echo $e->getMessage();
}
});

$fiber->start();

// Reprend l'exécution de la fibre en
// passant l'Exception à lancer au point d'interruption
$fiber->throw(new Exception('Message d\'une exception lancée au point d\'interruption courant'));

?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Message d'une exception lancée au point d'interruption courant
]]>
</screen>
</informalexample>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down
Loading