Contributions are ready for review

From: Date: Mon, 07 Nov 2016 13:00:04 +0000
Subject: Contributions are ready for review
Groups: php.doc.it 
Request: Send a blank email to doc-it+get-2051@lists.php.net to get a copy of this message
Hello PHP IT Documentation team, There are contributions within the online editor queue for this language. Please review, then commit or delete these patches. Patches for review : ----------------------- New file: it/language/types/object.xml By: Sven Holmgren on 2016-11-06 23:57:57 =================================================================== --- it/language/types/object.xml +++ it/language/types/object.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- EN-Revision: 335216 Maintainer: SvenHolmgren Status: ready --> + +<sect1 xml:id="language.types.object"> + <title>Objects</title> + + <sect2 xml:id="language.types.object.init"> + <title>Inizializzazione di un object</title> + + <para> + Per creare un nuovo <type>object</type>, utilizzare l'istruzione <literal>new</literal> + per istanziare una classe: + </para> + + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +class foo +{ + function do_foo() + { + echo "Doing foo."; + } +} + +$bar = new foo; +$bar->do_foo(); +?> +]]> + </programlisting> + </informalexample> + + <simpara> + Per una discussione completa, vedere il capitolo + <link linkend="language.oop5">Classi e Oggetti</link>. + </simpara> + + </sect2> + + <sect2 xml:id="language.types.object.casting"> + <title>Conversione a object</title> + + <para> + se un <type>object</type> viene convertito in un altro <type>object</type>, non subisce + modifiche. Se un valore di un qualsiasi altro tipo viene convertito ad + <type>object</type>, una nuova istanza della classe built-in + <literal>stdClass</literal> viene creata. Se il valore era &null;, la nuova istanza sarà + vuota. Un <type>array</type> viene convertito in <type>object</type> utilizzando i nomi + degli indici ed il loro corrispondente valore come attributi, fatta eccezione + per gli indici numerici, i quali saranno inaccessibili a meno che non vengano iterati. + </para> + + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$obj = (object) array('1' => 'foo'); +var_dump(isset($obj->{'1'})); // outputs 'bool(false)' +var_dump(key($obj)); // outputs 'int(1)' +?> +]]> + </programlisting> + </informalexample> + + <para> + Per ogni altro valore, una variabile di classe chiamata <literal>scalar</literal> conterrà + quel valore. + </para> + + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$obj = (object) 'ciao'; +echo $obj->scalar; // outputs 'ciao' +?> +]]> + </programlisting> + </informalexample> + + </sect2> +</sect1> + +<!-- 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 +--> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=69831 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=69831 ------------------------------------------------------------------ -- https://edit.php.net/ This email is send automatically by the Php Docbook Online Editor.

« previous php.doc.it (#2051) next »