Re: php7- dropping the $ from the variable name - rfc
| From: | Guilherme Blanco | Date: | Sat, 20 Sep 2008 10:02:29 +0000 |
| Subject: | Re: php7- dropping the $ from the variable name - rfc | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-40570@lists.php.net to get a copy of this message | ||
Since these are all valid requests (I really enjoyed the euro sign
one), I'd suggest to import some ideas from Fortran and Python.
The first request is to remove the ; sign. It's annoying and everyone
here knows it. =)
My second request is is column identing.
PHP should support = assignment if defined in column 0, example:
<?php
$foo "value" // equivalent to $foo = "value"; nowadays
And since we may have to deal with other interesting situations (like
+=, -=, etc), you should put the sign before left expression
+ $foo "value" // which means $foo += "value";
The idea should be followed for:
0 equivalent to = assignment
1 equivalent to method or function call
2 function or method definition
3 normal code
4 loop
..
The idea is very simple and imagine this source that currently works:
class Foo
{
public static function bar()
{
$str = '';
for ($i = 0, $l = 10; $i < $l; $i++)
{
$str += '[' . $i . ']';
}
return $str;
}
}
Will be simplified a lot into (and also include the euro sign suggestion):
class Foo
static bar()
€str ''
€i = 0, €l = 10; €i < €l; €i++
+ €str '[' . €i . ']'
return €str
Of course this is just a RFC and we should start endless discussions
to define new terminals in grammar, but I would love to see that into
PHP 7!!!!
Cheers,
On Fri, Sep 19, 2008 at 7:47 PM, Marcus Boerger <helly@php.net> wrote:
> Hello Ionut,
>
> a Friend suggested to replace it with a Euro sign, so that PHP code gets
> worth more :-)
>
> marcus
>
> Thursday, September 18, 2008, 8:30:37 PM, you wrote:
>
>> Actually, I somehow understand what he wants, considering we'll soon
>> have lambdas and closures. I mean, in case of javascript a variable can
>> hold as well a function as it can hold anything else. Anyway, I don't
>> think this is the case for PHP. I do find it ugly to write $function(),
>> but I guess I'll live with it as I did until now.
>
>> Cheers,
>> I. Stan
>
>
>
>
>> ----- Original Message ----
>> From: Brian Moon <brianm@dealnews.com>
>> To: mike <mike503@gmail.com>
>> Cc: marius popa <mapopa@gmail.com>; internals@lists.php.net
>> Sent: Thursday, September 18, 2008 9:06:11 PM
>> Subject: Re: [PHP-DEV] php7- dropping the $ from the variable name - rfc
>
>> mike wrote:
>>> Personally I love the $. It makes it so much easier to identify
>>> variables. It's a single character. Can't see the need honestly to
>>> even bring this up.
>
>> +1,000,000. Horrible idea. *facepalm*
>
>> --
>
>> Brian Moon
>> Senior Web Engineer
>> ------------------------------
>> When you care enough to spend the very least.
>> http://dealnews.com/
>
>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>>
>
>
>
>
> Best regards,
> Marcus
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: guilhermeblanco@hotmail.com
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil