On 7/20/12 2:33 AM, "Anthony Ferrara" wrote:
>Hey all,
>
>So I've been thinking about this for a while. Here's what I've come up
>with:
>
>1. We want to maintain loose typing, so implementing a different API on
>string than on int types would be bad.
>
>2. We want to retain backwards compatibili
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
Anthony, the whole concept is interesting. Can you probably write that as RFC.
I believe that will make it easier to read/understand it.
Right now, I have only one question:
On 20.07.2012, at 4:33, Anthony Ferrara wrote:
> The benefit here, is that user types can implement the same "core" inter
On 20.07.2012, at 4:09, Stas Malyshev wrote:
> Hi!
>
>> 2. It would be really useful to have 2 versions of each function: one
>> which mutates the variable and one which returns the new variable.
>>
>> Example:
>>
>> > 'source', $src == 'SoUrCe' $result = lower($srd); // $result ==
>> true,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
- -BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Am 20.07.2012 02:09, schrieb Stas Malyshev:
> Hi!
>
>> 2. It would be really useful to have 2 versions of each
>> function: one which mutates the variable and one which returns
>> the new variable.
>>
Hey all,
So I've been thinking about this for a while. Here's what I've come up with:
1. We want to maintain loose typing, so implementing a different API on
string than on int types would be bad.
2. We want to retain backwards compatibility to some extent with the legacy
API.
3. We want the ab
Hi!
> 2. It would be really useful to have 2 versions of each function: one
> which mutates the variable and one which returns the new variable.
>
> Example:
>
> 'source', $src == 'SoUrCe' $result = lower($srd); // $result ==
> true, $src = 'source' ?>
>
I'm not sure I understand why. What
One consideration: Should be a general array/string/int/float/bool API. PHP
is weakly typed: therefore, say, reverse() would reverse a string OR an
array. negate() would invert a bool, negate an int/float. slice() would
slice a section of a string OR an array. max() would find maximum of an
array,
Stas made a good point about need to start with new API, which then can be
followed by syntactic sugar.
So, we need some ideas to start with:
1. A lot of people told, that it would be a good idea to come with a written
standard regarding arguments order. I don't care what it will be, as long as