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


Reply via email to