svn: /phpdoc/it/trunk/reference/misc/functions/ eval.xml
| From: | Davide Pastore | Date: | Tue, 09 Aug 2016 16:42:58 +0000 |
| Subject: | svn: /phpdoc/it/trunk/reference/misc/functions/ eval.xml | ||
| Groups: | php.doc.it | ||
| Request: | Send a blank email to doc-it+get-2015@lists.php.net to get a copy of this message | ||
pastore Tue, 09 Aug 2016 16:42:58 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339831
Log:
Sync with EN
Changed paths:
A phpdoc/it/trunk/reference/misc/functions/eval.xml
Added: phpdoc/it/trunk/reference/misc/functions/eval.xml
===================================================================
--- phpdoc/it/trunk/reference/misc/functions/eval.xml (rev 0)
+++ phpdoc/it/trunk/reference/misc/functions/eval.xml 2016-08-09 16:42:58 UTC (rev 339831)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- EN-Revision: 321375 Maintainer: reghe Status: ready -->
+<refentry xml:id="function.eval" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>eval</refname>
+ <refpurpose>Esegue una stringa come codice PHP</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>mixed</type><methodname>eval</methodname>
+
<methodparam><type>string</type><parameter>code</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Esegue la data stringa <parameter>code</parameter> come codice PHP.
+ </para>
+ <caution>
+ <para>
+ <function>eval</function> è un costrutto del linguaggio <emphasis>molto
pericoloso</emphasis>
+ perché permette l'esecuzione di codice PHP arbitrario. <emphasis>Il suo uso è
pertanto
+ sconsigliato.</emphasis> Se si è certi che non esistono altre soluzioni al posto di
usare
+ <function>eval</function>, fare particolare attenzione a <emphasis>non
inserire codice fornito
+ dall'utente</emphasis> senza averlo preventivamente validato.
+ </para>
+ </caution>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>code</parameter></term>
+ <listitem>
+ <para>
+ Codice PHP valido da eseguire.
+ </para>
+ <para>
+ Il codice non deve essere incluso nei <link
linkend="language.basic-syntax.phpmode">tag
+ di apertura e chisura</link> di PHP. Ad esempio
+ <literal>'echo "Ciao!";'</literal> è corretto invece di
+ <literal>'<? echo "Ciao!"; >'</literal>. È
comunque possibile uscire e
+ rientrare nella modalità PHP attraverso l'utilizzo dei tag PHP appropriati, ad
esempio:
+ <literal>'echo "In PHP mode!"; ?>In HTML mode!<? echo
"Back in PHP mode!";'</literal>.
+ </para>
+ <para>
+ Oltre a questo, valgono tutte le regole del codice PHP. Questo include l'inserimento al
termine
+ di ogni istruzione del punto e virgola.
+ <literal>'echo "Ciao!"'</literal> per esempio causerà un
parse error, mentre
+ <literal>'echo "Ciao!";'</literal> funzionerà.
+ </para>
+ <para>
+ Un'istruzione <literal>return</literal> causa immediatamente la
terminazione del codice
+ in corso di esecuzione dalla <function>eval</function>.
+ </para>
+ <para>
+ L'ambito di esecuzione è ristretto a dove <function>eval</function> viene
chiamata. Quindi qualsiasi
+ variabile definita o modificata all'interno di <function>eval</function>
rimarrà visibile dopo
+ la sua terminazione.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ <function>eval</function> ritorna &null; a meno che
+ non venga richiamato <literal>return</literal> nel codice da valutare, in tal caso
+ il valore passato a <literal>return</literal> viene ritornato. Se avviene un
+ parse error nel codice valutato, <function>eval</function> ritorna
+ &false; e l'esecuzione del codice seguente continua normalmente. Non
+ è possibile catturare un parse error in <function>eval</function>
+ usando <function>set_error_handler</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Esempio di <function>eval</function> - semplice unione di
testo</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$string = 'cup';
+$name = 'coffee';
+$str = 'This is a $string with my $name in it.';
+echo $str. "\n";
+eval("\$str = \"$str\";");
+echo $str. "\n";
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+This is a $string with my $name in it.
+This is a cup with my coffee in it.
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+
+ ¬e.language-construct;
+
+ &tip.ob-capture;
+ <note>
+ <para>
+ In caso di fatal error nel codice valutato, l'intero script termina.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>call_user_func</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
+-->
Property changes on: phpdoc/it/trunk/reference/misc/functions/eval.xml
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL