Hi!

>> I'm not sure I understand why. What's wrong with $src =
>> lowered($src);?
> 
> That's just convenience. matter of readability.

IMHO assignment is always more readable than function with magic
unobvious effects. I'd rather always have assignments than scratch my
head each time reading the code - is this the one that modifies the
argument or the one that doesn't?

>> Strings are not modified in PHP (IS_STRING zvals can be modified
>> but the actual string buffers aren't) so there's no actual "write"
>> and thus no copy needed. But having this would require separate
>> refcounting on string values, which may be a bit complicated to
>> do.
> 
> much worse than that. refcounting on string-slices!

We won't need to refcount slices since we won't be able to free a slice.
We would have however to refcount the string to know if there's a slice
referring to it or we can free it.

]>> We already have it, it's str_split().
> 
> I know. But that is not "casting". I can not pass string to the
> function which expects array (thinking about array_map, array_filter,
> …). I have to call str_split explicitly.

So what? There's nothing wrong with array_map(str_split()) - on the
contrary, it makes it clearer that you're taking a string and splitting
it into an array.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to