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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: germain at ebooksfrance dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 17:01:31 2025 UTC