mirror of
https://github.com/php/doc-it.git
synced 2026-03-24 07:32:12 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@339828 c90b9560-bf6c-de11-be94-00142212c4b1
129 lines
3.5 KiB
XML
129 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: reghe Status: ready -->
|
|
<refentry xml:id="function.define" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>define</refname>
|
|
<refpurpose>Definisce una costante</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>define</methodname>
|
|
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>case_insensitive</parameter><initializer>false</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Definisce una costante alfanumerica durante l'esecuzione.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Il nome della costante.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Il valore della costante; solo valori scalari e <type>null</type> sono consentiti.
|
|
I valori scalari comprendono <type>integer</type>,
|
|
<type>float</type>, <type>string</type> o <type>boolean</type>. E' anche
|
|
possibile definire costanti di tipo <type>resource</type>, tuttavia non è raccomandato
|
|
e può causare comportamenti imprevedibili.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>case_insensitive</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Se settato a &true;, la costante viene definita case-insensitive.
|
|
Il comportamento di default è case-sensitive; per esempio
|
|
<literal>CONSTANT</literal> e <literal>Constant</literal> rappresentano
|
|
valori diversi.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Le costanti case-insensitive vengono salvate internamente in minuscolo.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Definire costanti</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
define("CONSTANT", "Ciao Mondo!");
|
|
echo CONSTANT; // output "Ciao Mondo!"
|
|
echo Constant; // output "Ciao Mondo!" e genera un notice.
|
|
|
|
define("GREETING", "Ciao Mondo!", true);
|
|
echo GREETING; // output "Ciao Mondo!"
|
|
echo Greeting; // output "Ciao Mondo!"
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>defined</function></member>
|
|
<member><function>constant</function></member>
|
|
<member>La sezione sulle <link linkend="language.constants">Costanti</link></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
|
|
-->
|