|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-03-20 05:10 UTC] andrej at cybernoidz dot de
My php-Code: <? $property [ "src" ][ "brett" ] = "DBJ_20020112.db.php"; $property [ "src" ][ "brett" ][ "entity" ] = "ABrettEntry"; // ---------------------------------------- $GLOBALS[ "property" ] = $property; echo( "AUSGABE1 ::: ".$property["src"]["brett"]["entity"]."<BR>" ); echo( "AUSGABE2 ::: ". $property [ "src" ][ "brett" ]."<BR>" ); ?> And the result of this script looks like this: AUSGABE1 ::: A AUSGABE2 ::: ABJ_20020112.db.php PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
the problem is that single character access to strings is still possible using either $string[...] or $string{...}, although using {} is recommended and [] more or less deprecated so what you did was assigning to the first character in a string ("entity" auto-converts to integer zero), and as a character position can only take a single character it took only the "A" from the newly assigned string