Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
[mailto:p...@hristov.com] Sent: 09 December 2010 10:14 To: PHP Internals List Subject: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only Hi guys, the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together

RE: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread James Butler
-Original Message- From: Andrey Hristov [mailto:p...@hristov.com] James Butler wrote: +1 million because GLOBAL scope is horrid (generally) and is thoroughly abused -1 million because it will be the most horrific BC break since time began and I imagine it will break so much code

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
James Butler wrote: -Original Message- From: Andrey Hristov [mailto:p...@hristov.com] James Butler wrote: +1 million because GLOBAL scope is horrid (generally) and is thoroughly abused -1 million because it will be the most horrific BC break since time began and I imagine it will

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Michael Shadle
On Thu, Dec 9, 2010 at 2:31 AM, James Butler james.but...@edigitalresearch.com wrote: Sorry, I wasn't being very clear there, what I really meant to say was will there be the will to remove it considering the effects. I suppose INI is enough to allow it to be easily changed, but would it ever

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Michael Shadle
On Thu, Dec 9, 2010 at 2:38 AM, Andrey Hristov p...@hristov.com wrote: Yes, as the documentation will mention how to do it, for old applications. For new apps it is easy - pass all the information you need as parameter to the function. It works in other languages, why shouldn't it work for

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Eloy Bote Falcon
2010/12/9 Andrey Hristov p...@hristov.com Reindl Harald wrote: Please do not global + GLOBALS can be used in so many ways and you would break 200.000 LOC only here which is running with reporting E_STRICT in a production environment what happened after register_globals was introduced

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Michael Shadle wrote: On Thu, Dec 9, 2010 at 2:38 AM, Andrey Hristov p...@hristov.com wrote: Yes, as the documentation will mention how to do it, for old applications. For new apps it is easy - pass all the information you need as parameter to the function. It works in other languages, why

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Eloy Bote Falcon wrote: 2010/12/9 Andrey Hristov p...@hristov.com Reindl Harald wrote: Please do not global + GLOBALS can be used in so many ways and you would break 200.000 LOC only here which is running with reporting E_STRICT in a production environment what happened after

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Derick Rethans
On Thu, 9 Dec 2010, Andrey Hristov wrote: the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only anyway. No thanks. Derick --

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Derick Rethans wrote: On Thu, 9 Dec 2010, Andrey Hristov wrote: the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only anyway. No thanks.

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Alain Williams
On Thu, Dec 09, 2010 at 11:53:08AM +0100, Andrey Hristov wrote: Is copying the POST variables into another variables best practice (like a manual register_globals)? In the global scope of the application I think it's cleaner to work with $_POST to overwrite the values than copying the items

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Alain Williams wrote: On Thu, Dec 09, 2010 at 11:53:08AM +0100, Andrey Hristov wrote: Is copying the POST variables into another variables best practice (like a manual register_globals)? In the global scope of the application I think it's cleaner to work with $_POST to overwrite the values

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Pierre Joye
hi, As far as I remember we discussed that already back to the phpI don't mention it discussions. It was not accepted because of the little gains in regard to the major BC breaks. However I would prefer, as far as it is technically possible, deprecate their usage (notices/warnings) and promote

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ferenc Kovacs
On Thu, Dec 9, 2010 at 11:14 AM, Andrey Hristov p...@hristov.com wrote: Hi guys, the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ferenc Kovacs
On Thu, Dec 9, 2010 at 12:15 PM, Pierre Joye pierre@gmail.com wrote: hi, As far as I remember we discussed that already back to the phpI don't mention it discussions. It was not accepted because of the little gains in regard to the major BC breaks. However I would prefer, as far as it

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Rasmus Lerdorf
On Dec 9, 2010, at 3:34, Ferenc Kovacs i...@tyrael.hu wrote: On Thu, Dec 9, 2010 at 12:15 PM, Pierre Joye pierre@gmail.com wrote: hi, As far as I remember we discussed that already back to the phpI don't mention it discussions. It was not accepted because of the little gains in

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Ferenc Kovacs wrote: On Thu, Dec 9, 2010 at 11:14 AM, Andrey Hristov p...@hristov.com mailto:p...@hristov.com wrote: Â Hi guys, the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ilia Alshanetsky
On Thu, Dec 9, 2010 at 5:14 AM, Andrey Hristov p...@hristov.com wrote:  Hi guys, the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only

RE: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread James Butler
-Original Message- From: Ilia Alshanetsky [mailto:i...@prohost.org] On Thu, Dec 9, 2010 at 5:14 AM, Andrey Hristov p...@hristov.com wrote:  Hi guys, the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Alain Williams
On Thu, Dec 09, 2010 at 01:15:41PM +0100, Andrey Hristov wrote: no, you got me wrong. I will repeat - global variables won't cease to exist, but $GLOBALS and global as means to access them should be removed. If a function needs data it should get it passed to it. By large yes, but in

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Adam Harvey
On 9 December 2010 18:14, Andrey Hristov p...@hristov.com wrote: the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only anyway. -1 here. No

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Adam Harvey wrote: On 9 December 2010 18:14, Andrey Hristov p...@hristov.com wrote: the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Rasmus Lerdorf
On 12/9/10 4:46 AM, Andrey Hristov wrote: There were many apps which relied on register_globals but register_globals was introduced. There were many apps which relied on references in PHP4, but the object model changed in 5, references too. There are apps which rely on magic_quotes, but magic

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Lars Schultz
is there any benefit in removing those features? I can see that Code using these features is probably designed badly or unconventionally, but php has never been a designers-language...right? It's always been about being easy to use. Even without globals you can still use: Class GLOBALS{

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Arvids Godjuks
Definitely a -1 for making read only. I kind'a like to apply filters to POST directly when validating forms so I clean up the user mess in it and if he makes a mistake in a form, to show him a cleaned up input. Also this is useful in other ways. Mixed feelings on other parts. From one point of

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Lester Caine
Rasmus Lerdorf wrote: Andrey, you have posted 9 messages on this in the past 3 hours. We have heard you. You don't need to keep saying the same thing over and over. And for the record, I strongly disagree with changing this. As someone who always seems to be doing things the wrong way,

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ángel González
Andrey Hristov wrote: I am not against global variables, I'm against usage of $GLOBALS and global. So how do you support global variables by banning the two ways they can be accessed? -1 From a Framework point of view, they should save all of the (super)global variables from the global

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Reindl Harald
Am 09.12.2010 13:46, schrieb Andrey Hristov: There were many apps which relied on register_globals but register_globals was introduced. There were many apps which relied on references in PHP4, but the object model changed in 5, references too. There are apps which rely on magic_quotes, but

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Ángel González wrote: Andrey Hristov wrote: I am not against global variables, I'm against usage of $GLOBALS and global. So how do you support global variables by banning the two ways they can be accessed? very easy, by using them by name. Global variables are those outside of a classes,

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Reindl Harald wrote: Am 09.12.2010 13:46, schrieb Andrey Hristov: There were many apps which relied on register_globals but register_globals was introduced. There were many apps which relied on references in PHP4, but the object model changed in 5, references too. There are apps which rely on

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Reindl Harald
Am 09.12.2010 17:19, schrieb Andrey Hristov: one day you might have to support globalized applications and I am sure you will feel very enlightened to fix them :) This is my problem and not yours There are thousands of scripts that are not big applications and running well, are secure and

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ferenc Kovacs
On Thu, Dec 9, 2010 at 5:19 PM, Andrey Hristov p...@hristov.com wrote: Reindl Harald wrote: Am 09.12.2010 13:46, schrieb Andrey Hristov: There were many apps which relied on register_globals but register_globals was introduced. There were many apps which relied on references in PHP4, but

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Reindl Harald wrote: Am 09.12.2010 17:19, schrieb Andrey Hristov: one day you might have to support globalized applications and I am sure you will feel very enlightened to fix them :) This is my problem and not yours sure, one's thrash is another mans cash. There are thousands of scripts

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Alain Williams
On Thu, Dec 09, 2010 at 05:40:09PM +0100, Reindl Harald wrote: Am 09.12.2010 17:19, schrieb Andrey Hristov: one day you might have to support globalized applications and I am sure you will feel very enlightened to fix them :) This is my problem and not yours There are thousands of

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Ferenc Kovacs wrote: On Thu, Dec 9, 2010 at 5:19 PM, Andrey Hristov p...@hristov.com mailto:p...@hristov.com wrote: Reindl Harald wrote: Am 09.12.2010 13:46, schrieb Andrey Hristov: There were many apps which relied on register_globals but

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Alain Williams wrote: On Thu, Dec 09, 2010 at 05:40:09PM +0100, Reindl Harald wrote: Am 09.12.2010 17:19, schrieb Andrey Hristov: one day you might have to support globalized applications and I am sure you will feel very enlightened to fix them :) This is my problem and not yours There are

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Reindl Harald
Am 09.12.2010 17:49, schrieb Andrey Hristov: sure, one's thrash is another mans cash. Stop this dumb style I know very well which script is good anough with a simple hack and where i have to do a real application style and i do not like braindead ideas forcing me to get lost this decision

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Pierre Joye
On Thu, Dec 9, 2010 at 5:55 PM, Andrey Hristov p...@hristov.com wrote: If all your functions take 15 params I am worried that your program design is flawed, sorry. That's not an argument to do it. PHP and all other languages have many ways to shoot yourself in the knees, but that's a reason

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Pierre Joye
On Thu, Dec 9, 2010 at 5:58 PM, Pierre Joye pierre@gmail.com wrote: On Thu, Dec 9, 2010 at 5:55 PM, Andrey Hristov p...@hristov.com wrote: If all your functions take 15 params I am worried that your program design is flawed, sorry. but that's a reason +not :) -- Pierre @pierrejoye

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Derick Rethans
On Thu, 9 Dec 2010, Andrey Hristov wrote: If all your functions take 15 params I am worried that your program design is flawed, sorry. Stop trying to tell people how they should write their code. It's not any of your business. Pragmatic application design is all great and wonderfull, but

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Reindl Harald wrote: Am 09.12.2010 17:49, schrieb Andrey Hristov: sure, one's thrash is another mans cash. Stop this dumb style I have been paid quite well for fixing other man's thrash because it just did not work. Thus, one's thrash is another man's cash. But do we want this a normal

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ángel González
Andrey Hristov wrote: Ángel González wrote: So how do you support global variables by banning the two ways they can be accessed? very easy, by using them by name. Global variables are those outside of a classes, methods and functions. If they can only be used outside functions they would be

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Pierre Joye wrote: On Thu, Dec 9, 2010 at 5:55 PM, Andrey Hristov p...@hristov.com wrote: If all your functions take 15 params I am worried that your program design is flawed, sorry. That's not an argument to do it. PHP and all other languages have many ways to shoot yourself in the knees,

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Pierre Joye
On Thu, Dec 9, 2010 at 6:06 PM, Andrey Hristov p...@hristov.com wrote: Pierre Joye wrote: On Thu, Dec 9, 2010 at 5:55 PM, Andrey Hristov p...@hristov.com wrote: If all your functions take 15 params I am worried that your program design is flawed, sorry. That's not an argument to do it.

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Ángel González wrote: Andrey Hristov wrote: Ángel González wrote: So how do you support global variables by banning the two ways they can be accessed? very easy, by using them by name. Global variables are those outside of a classes, methods and functions. If they can only be used outside

RE: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread James Butler
argument... -Original Message- From: Pierre Joye [mailto:pierre@gmail.com] Sent: 09 December 2010 16:59 To: Andrey Hristov Cc: PHP Internals List Subject: Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only On Thu, Dec 9, 2010 at 5:58 PM, Pierre

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Lester Caine
Andrey Hristov wrote: You probably got me wrong. The code will be broken and can be fixed. It's not like going line by line and checking whether everything will work. I'm tired of explaining this. SO you are happy to do all that work for us for free? Only recently has PHP4 been dropped from

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Andrey Hristov
Hi Lester, Lester Caine wrote: Andrey Hristov wrote: You probably got me wrong. The code will be broken and can be fixed. It's not like going line by line and checking whether everything will work. I'm tired of explaining this. SO you are happy to do all that work for us for free? Only

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Richard Quadling
On 9 December 2010 17:08, Pierre Joye pierre@gmail.com wrote: On Thu, Dec 9, 2010 at 6:06 PM, Andrey Hristov p...@hristov.com wrote: s,foot,knee, same idea: http://www.urbandictionary.com/define.php?term=shoot%20yourself%20in%20the%20foot And it isn't just your foot you can shoot!

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Giorgio Sironi
On Thu, Dec 9, 2010 at 12:21 PM, Ferenc Kovacs i...@tyrael.hu wrote: And what about global constants? They are also screwing up the Dependency Injection, and the static functions/properties, and the  singletons also.  Should we ban those? You got right to the point. It's no use removing this

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Stas Malyshev
Hi! the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making No, I think it's a bad idea. I know over-using globals is bad, but they still have their uses and huge amount of apps is using them one way or another.

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Michael Morris
On removing globals / $GLOBALS, erm, -1 to that. Just too much legacy code needs this to work as is. On making $_POST, $_REQUEST, $_GET et al read only, again -1 for the same reason. However, I understand the sentiment and it brings up this idea... What about a new superglobal, $_INPUT, that is

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Johannes Schlüter
On Thu, 2010-12-09 at 14:58 -0500, Michael Morris wrote: Since $_INPUT would be read only from inception nothing can break because it can't be written to. At an INI level the option to turn off the legacy superglobals it replaces might be added, but that's a separate issue. The filter

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Rick Widmer
On 12/9/2010 9:53 AM, Andrey Hristov wrote: . fixing a design flaw of the past, evolution in other words. Global and $GLOBALS are not a design flaw! They are a carefully thought out technique to insure that you do not shoot your self in the foot by accidentally accessing a global variable

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ángel González
On Thu, Dec 9, 2010 at 11:42, Michael Shadle wrote: Not to mention, I have had issues (and I can't reproduce it properly or I would report it) where sometimes i will have a variable in global scope in one file, and I have to reference it as $GLOBALS['variable'] in another include, or I have

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Michael Shadle
2010/12/9 Ángel González keis...@gmail.com: Not to mention, I have had issues (and I can't reproduce it properly or I would report it) where sometimes i will have a variable in global scope in one file, and I have to reference it as $GLOBALS['variable'] in another include, or I have to global

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Larry Garfield
On Thursday, December 09, 2010 4:44:44 am Michael Shadle wrote: On Thu, Dec 9, 2010 at 2:38 AM, Andrey Hristov p...@hristov.com wrote: Yes, as the documentation will mention how to do it, for old applications. For new apps it is easy - pass all the information you need as parameter to the