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/
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.
So if you drop the '$' the way that you call a function referenced in variable
'funref' is not:
$funref()
but
funref()
However: the PHP parser will take that to be a call to a function named 'funref'.
So you need to change the syntax to, perhaps, something like C:
(funref)()
I can't see people understanding that.
Stick with what we have.
--
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h
Alain Williams 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.So if you drop the '$' the way that you call a function referenced in variable
'funref' is not:$funref()
but
funref()
However: the PHP parser will take that to be a call to a function named 'funref'.
So you need to change the syntax to, perhaps, something like C:(funref)()
I can't see people understanding that.
Stick with what we have.
There is no difference between a function and a variable which holds a
closure in many languages (e.q. JavaScript, LUA, ...), so you don't need
any extra syntax rules.
function foo() {
}
foo();
var bar = function() {
}
bar();
It's not possible to make the same unification with PHP's $, however I
don't see a way to remove $.
Thanks. Dmitry.
Well, you can do that right now, PHP supports that for ages.
<?php
$myVar = 'print';
$myVar('Hello!'); // Outputs hello
?>
So lamdas realy do not change anything in this context. What they do is make
our life easier by making us able to live without create_function()
.
Anyway, removing $ is bad and people gave plenty of points for that. Here is
summary:
1). Break every application.
2). Break highlight.
3). Make almost imposible for parser to replace variables with their
contents in " " and HEREDOC constructions. Well, it can be done, but it will
make a huge slowdown and memory usage.
4). Adding $ before variable doesn't take any time for any experienced in
PHP developer
5). Variables are seen clearly in code.
6). Hey, you can use $ in JS too! It just works! :)
2008/9/18 Ionut Gabriel Stan ionut.stan@yahoo.com
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 - rfcmike 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 EngineerWhen you care enough to spend the very least.
http://dealnews.com/
On Thu, Sep 18, 2008 at 9:09 PM, Arvids Godjuks
arvids.godjuks@gmail.com wrote:
Well, you can do that right now, PHP supports that for ages.
<?php
$myVar = 'print';
$myVar('Hello!'); // Outputs hello
?>
Partly because I can't resist being smug, partly because it might
confuse someone, I have to point out that that example won't work,
because pint isn't a function. It would work with most everything else
though.
--
troels
On Thu, Sep 18, 2008 at 12:25 PM, troels knak-nielsen
troelskn@gmail.com wrote:
On Thu, Sep 18, 2008 at 9:09 PM, Arvids Godjuks
arvids.godjuks@gmail.com wrote:Well, you can do that right now, PHP supports that for ages.
<?php
$myVar = 'print';
$myVar('Hello!'); // Outputs hello
?>Partly because I can't resist being smug, partly because it might
confuse someone, I have to point out that that example won't work,
because pint isn't a function. It would work with most everything else
though.--
troels--
You're right, "pint" isn't a function, and neither is "print".
;)
--
Jordan Ryan Moore
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 EngineerWhen you care enough to spend the very least.
http://dealnews.com/
--
Best regards,
Marcus
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,
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 - rfcmike 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 EngineerWhen you care enough to spend the very least.
http://dealnews.com/--
Best regards,
Marcus--
--
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
Marcus Boerger kirjoitti:
Hello Ionut,
a Friend suggested to replace it with a Euro sign, so that PHP code gets
worth more :-)
Hey, why not make it configurable (ini option) ?! :D
--Jani
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 - rfcmike 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 EngineerWhen you care enough to spend the very least.
http://dealnews.com/--
Best regards,
Marcus
On Sat, 20 Sep 2008 16:43:52 +0300, Jani Taskinen jani.taskinen@sci.fi
wrote:
Marcus Boerger kirjoitti:
Hello Ionut,
a Friend suggested to replace it with a Euro sign, so that PHP code
gets
worth more :-)Hey, why not make it configurable (ini option) ?! :D
I really do not find it reasonable to change the dollar sign to something
else.
If we could switch the dollar sign notation in variables on and off
with a directive in php.ini, that would break backwards compatibility
between apps
not only in a single user environments but also in shared hosting envs.
Imagine having to switch into dollar sign notation for a phpbb installation
and to a notation without the dollar sign for a custom application. It's
just
crazy!
Sotiris
--Jani
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 -
rfcmike 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 EngineerWhen you care enough to spend the very least.
http://dealnews.com/--
Best regards,
Marcus
On Sat, 20 Sep 2008 16:43:52 +0300, Jani Taskinen jani.taskinen@sci.fi
wrote:Marcus Boerger kirjoitti:
Hello Ionut,
a Friend suggested to replace it with a Euro sign, so that PHP code
gets
worth more :-)Hey, why not make it configurable (ini option) ?! :D
I really do not find it reasonable to change the dollar sign to something
else.
If we could switch the dollar sign notation in variables on and off
with a directive in php.ini, that would break backwards compatibility
between apps
not only in a single user environments but also in shared hosting envs.
Imagine having to switch into dollar sign notation for a phpbb installation
and to a notation without the dollar sign for a custom application. It's
just
crazy!
I doubt that that was a serious suggestion. Just a joke.
Although I do like the idea of replacing dollar with euro .... :-)
--
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h
Hey, why not make it configurable (ini option) ?! :D
I really do not find it reasonable to change the dollar sign to something
else.
If we could switch the dollar sign notation in variables on and off
with a directive in php.ini, that would break backwards compatibility
between apps
not only in a single user environments but also in shared hosting envs.
Imagine having to switch into dollar sign notation for a phpbb installation
and to a notation without the dollar sign for a custom application. It's
just
crazy!
http://en.wikipedia.org/wiki/Sarcasm ... I hope :-D
Regards
Marco
Marco wrote:
So don't you consider this a serious reason against stripping/changing
the dollar sign?
Do you think that would be a good effect for PHP users if that change
would exist
in a future version of PHP (even in PHP6!)? It's a simple change but a
great shift!
> Hey, why not make it configurable (ini option) ?! :D I really do not find it reasonable to change the dollar sign to something else. If we could switch the dollar sign notation in variables on and off with a directive in php.ini, that would break backwards compatibility between apps not only in a single user environments but also in shared hosting envs. Imagine having to switch into dollar sign notation for a phpbb installation and to a notation without the dollar sign for a custom application. It's just crazy!
http://en.wikipedia.org/wiki/Sarcasm ... I hope :-D
I'm not being sarcastic, if you mean it. :pRegards
Marco
@sotiris:
explain me how will does this be handled:
$array_pop = 'foo';
$test = $array_pop($arrayFoo); // $test = foo($arrayFoo);
if you remove the $....
array_pop = 'foo';
test = array_pop(arrayFoo); // huh?!?!?!
Cheers,
Marco wrote:
So don't you consider this a serious reason against stripping/changing the
dollar sign?
Do you think that would be a good effect for PHP users if that change would
exist
in a future version of PHP (even in PHP6!)? It's a simple change but a great
shift!Hey, why not make it configurable (ini option) ?! :D
I really do not find it reasonable to change the dollar sign to
something
else.
If we could switch the dollar sign notation in variables on and off
with a directive in php.ini, that would break backwards compatibility
between apps
not only in a single user environments but also in shared hosting
envs.
Imagine having to switch into dollar sign notation for a phpbb
installation
and to a notation without the dollar sign for a custom
application. It's
just
crazy!http://en.wikipedia.org/wiki/Sarcasm ... I hope :-D
I'm not being sarcastic, if you mean it. :p
Regards
Marco
--
--
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
Guilherme Blanco wrote:
@sotiris:
explain me how will does this be handled:
$array_pop = 'foo';
$test = $array_pop($arrayFoo); // $test = foo($arrayFoo);
if you remove the $....
array_pop = 'foo';
test = array_pop(arrayFoo); // huh?!?!?!
Guilherme,
I suggest keeping the $ sign in the syntax scheme of PHP; that is clear
in my prior
responses. Why do you actually ask this? Changing the way variables are
denoted
by stripping the dollar sign obviously breaks previous syntax
functionality offered
by PHP (indirect function calls through variables).
Cheers,
Marco wrote:
So don't you consider this a serious reason against stripping/changing the
dollar sign?
Do you think that would be a good effect for PHP users if that change would
exist
in a future version of PHP (even in PHP6!)? It's a simple change but a great
shift!Hey, why not make it configurable (ini option) ?! :D
I really do not find it reasonable to change the dollar sign to
something
else.
If we could switch the dollar sign notation in variables on and off
with a directive in php.ini, that would break backwards compatibility
between apps
not only in a single user environments but also in shared hosting
envs.
Imagine having to switch into dollar sign notation for a phpbb
installation
and to a notation without the dollar sign for a custom
application. It's
just
crazy!http://en.wikipedia.org/wiki/Sarcasm ... I hope :-D
I'm not being sarcastic, if you mean it. :p
Regards
Marco
Apropos of nothing, if you are all looking for something to reclaim,
then how about dropping # as a comment. We've got block and single
line comments already with /* */ and //.
Then # could be the namespace separator and solve all these issues
about conflicts between namespace::function and class::static.
namespace#function() is very much distinguishable to class::static()
Richard.
--
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
Finally something that makes sense or at least worthy of discussion!!
But not at this thread.
Cheers,
On Sat, Sep 20, 2008 at 6:15 PM, Richard Quadling
rquadling@googlemail.comwrote:
Apropos of nothing, if you are all looking for something to reclaim,
then how about dropping # as a comment. We've got block and single
line comments already with /* */ and //.Then # could be the namespace separator and solve all these issues
about conflicts between namespace::function and class::static.namespace#function() is very much distinguishable to class::static()
Richard.
--
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"--
--
Diego
www.dnfeitosa.com