Re: No notices for undefined index
| From: | Ashley Sheridan | Date: | Fri, 09 Apr 2010 19:36:16 +0000 |
| Subject: | Re: No notices for undefined index | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303954@lists.php.net to get a copy of this message | ||
On Fri, 2010-04-09 at 14:15 +0100, Nathan Rixham wrote:
> Ashley Sheridan wrote:
> > can't find anything in the manual that explains what should happen when
> > you treat a string like an array in PHP.
>
>
> http://www.php.net/manual/en/language.types.string.php#language.types.string.substr
>
> :)
>
Thanks, and I think that page answers the whole question:
"Writing to an out of range offset pads the string with spaces.
Non-integer types are converted to integer. Illegal offset type emits
E_NOTICE. Negative offset emits E_NOTICE in write but reads empty
string. Only the first character of an assigned string is used.
Assigning empty string assigns NUL byte."
Thanks,
Ash
http://www.ashleysheridan.co.uk