mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fixed bug#41494 (binary typecasting)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@236255 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
f10636e367
commit
20ee32ff9f
1 changed files with 18 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.178 $ -->
|
||||
<!-- $Revision: 1.179 $ -->
|
||||
<chapter id="language.types">
|
||||
<title>Types</title>
|
||||
|
||||
|
@ -2561,6 +2561,9 @@ $bar = (boolean) $foo; // $bar is a boolean
|
|||
<listitem>
|
||||
<simpara>(string) - cast to string</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>(binary) - cast to binary string (PHP 6)</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>(array) - cast to array</simpara>
|
||||
</listitem>
|
||||
|
@ -2569,6 +2572,9 @@ $bar = (boolean) $foo; // $bar is a boolean
|
|||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
(binary) casting and b prefix forward support was added in PHP 5.2.1
|
||||
</para>
|
||||
<para>
|
||||
Note that tabs and spaces are allowed inside the parentheses, so
|
||||
the following are functionally equivalent:
|
||||
|
@ -2579,6 +2585,17 @@ $bar = (boolean) $foo; // $bar is a boolean
|
|||
$foo = (int) $bar;
|
||||
$foo = ( int ) $bar;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Casting a literal strings and variables to binary strings:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$binary = (binary)$string;
|
||||
$binary = b"binary string";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
|
Loading…
Reference in a new issue