$str{42} isn't deprecated (yet?), but $str[42] is preferred. We'll mention that.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@212400 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2006-05-04 02:21:28 +00:00
parent f3df60a998
commit e225b716c5

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.165 $ -->
<!-- $Revision: 1.166 $ -->
<chapter id="language.types">
<title>Types</title>
@ -1089,9 +1089,8 @@ echo "I'd like to have another {${ strrev('reeb') }}, hips";
</para>
<note>
<simpara>
For backwards compatibility, you may still use braces like
<varname>$str{42}</varname> for the same purpose. However, this syntax
is deprecated as of PHP 6.
They may also be accessed using braces like <varname>$str{42}</varname>
for the same purpose. However, using square array-brackets is preferred.
</simpara>
</note>
<para>
@ -1115,7 +1114,7 @@ $last = $str[strlen($str)-1];
$str = 'Look at the sea';
$str[strlen($str)-1] = 'e';
// Deprecated syntax with braces
// Alternative method using {}
$third = $str{2};
?>