php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11379 Local/Global variable scope inside functions
Submitted: 2001-06-09 15:04 UTC Modified: 2002-02-24 03:59 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: germain at ebooksfrance dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.5 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 18 = ?
Subscribe to this entry?

 
 [2001-06-09 15:04 UTC] germain at ebooksfrance dot com
Hello,

I just wanted to tell you that hidding Global scope variables when you are inside a function seems really totally weird to me...

Why do I have to make a Global statement with hundreds of variables names each time I want to build a function ?
I had created those as Global in the main code, so why the hell should I declare them global again ???

Now each time I want to build a function, I think twice about it because there are so much scope troubles that it is very hard to do... aren't functions supposed to simplify the code ?

Anyway, thanks you very much for PHP, it is a great language... to me, it would be absolutely perfect without this scope problem

Germain

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-24 03:35 UTC] roberto at berto dot net
I suggest the creating of a allways global scope's function like at http://bugs.php.net/bug.php?id=14712
 [2002-02-24 03:59 UTC] yohgaki@php.net
Sorry. It probably won't happen.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed May 25 06:05:43 2022 UTC