svn: /phpdoc/en/trunk/appendices/migration56/ new-features.xml

From: Date: Mon, 01 Sep 2014 18:10:10 +0000
Subject: svn: /phpdoc/en/trunk/appendices/migration56/ new-features.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-12777@lists.php.net to get a copy of this message
salathe Mon, 01 Sep 2014 18:10:10 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=334711 Log: fix build (and revert accidental changes) Changed paths: U phpdoc/en/trunk/appendices/migration56/new-features.xml Modified: phpdoc/en/trunk/appendices/migration56/new-features.xml =================================================================== --- phpdoc/en/trunk/appendices/migration56/new-features.xml 2014-09-01 18:10:06 UTC (rev 334710) +++ phpdoc/en/trunk/appendices/migration56/new-features.xml 2014-09-01 18:10:10 UTC (rev 334711) @@ -252,7 +252,7 @@ <![CDATA[ <?php $a = gmp_init(42); -$b = gmp_init(17);xcvxgvserfserfsfsdfsdfsdf +$b = gmp_init(17); // Pre-5.6 code: var_dump(gmp_add($a, $b)); @@ -307,6 +307,50 @@ </informalexample> </sect2> + <sect2 xml:id="migration56.new-features.debuginfo"> + <title><literal>__debugInfo()</literal></title> + + <para> + The <link linkend="language.oop5.magic.debuginfo">__debugInfo()</link> + magic method has been added to allow objects to change the properties and + values that are shown when the object is output using + <function>var_dump</function>. + </para> + + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +class C { + private $prop; + + public function __construct($val) { + $this->prop = $val; + } + + public function __debugInfo() { + return [ + 'propSquared' => $this->prop ** 2, + ]; + } +} + +var_dump(new C(42)); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(C)#1 (1) { + ["propSquared"]=> + int(1764) +} +]]> + </screen> + </informalexample> + </sect2> + <sect2 xml:id="migration56.new-features.gost"> <title>gost-crypto hash algorithm</title> @@ -338,13 +382,13 @@ section of this migration guide. </para> </sect2> -sdfsdfsdfsdf + <sect2 xml:id="migration56.new-features.postgresql"> <title><link linkend="book.pgsql">pgsql</link> async support</title> -xcvxcv + <para> The <link linkend="book.pgsql">pgsql</link> extension now supports - asynchronous cosdfsdfnnections and queries, thereby enabling non-blocking + asynchronous connections and queries, thereby enabling non-blocking behaviour when interacting with PostgreSQL databases. Asynchronous connections may be established via the <constant>PGSQL_CONNECT_ASYNC</constant> constant, and the new

« previous php.doc.cvs (#12777) next »