Req #50110 [Com]: Static (File Scope) Variables

2012-08-12 Thread youdontneedme at o2 dot pl
Edit report at https://bugs.php.net/bug.php?id=50110&edit=1

 ID: 50110
 Comment by: youdontneedme at o2 dot pl
 Reported by:n8grndr1087 at optonline dot net
 Summary:Static (File Scope) Variables
 Status: Open
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:*
 Block user comment: N
 Private report: N

 New Comment:

There is no information about such usage in documentation. (well, maybe that's 
why it does not work)

But if such usage is not documented why syntax:

static $age = 18;

is *valid* outside class?

I agree, this should have same consequences as in C lang.


Previous Comments:

[2009-11-07 18:19:38] n8grndr1087 at optonline dot net

This feature would also be useful for static (file scope) functions as well.


[2009-11-07 05:07:19] n8grndr1087 at optonline dot net

Description:

Global variables should be able to be declared 'static'.
Static globals, like in C, would only be accessible from the current file's 
scope. This would be a good way to protect internal variables used behind the 
scenes in a particular file. 

If there is any effective way to protect variables that I overlooked, outside 
of PHP classes, let me know. I understand that the possibility of this depends 
on how the include/file processing mechanism works.

Reproduce code:
---
myvar.inc: 


test.php: 
';
set_myvar(0);
$myvar = 1;
echo get_myvar();
?>

Expected result:

1
0

Actual result:
--
1
1






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=50110&edit=1


Req #46894 [Com]: Syntax errors in php.ini go unnoticed

2011-09-27 Thread youdontneedme at o2 dot pl
Edit report at https://bugs.php.net/bug.php?id=46894&edit=1

 ID: 46894
 Comment by: youdontneedme at o2 dot pl
 Reported by:ilatypov at infradead dot org
 Summary:Syntax errors in php.ini go unnoticed
 Status: Open
 Type:   Feature/Change Request
 Package:Feature/Change Request
 Operating System:   Windows XP Pro
 PHP Version:6CVS-2008-12-18 (snap)
 Block user comment: N
 Private report: N

 New Comment:

I've also found syntax error in php.ini in php 5.4b1:

In line 601 [both php.ini devel and production] is:
: paid for the registration of these arrays and because ENV is not as commonly

should be:
; paid for the registration of these arrays and because ENV is not as commonly


Note that there is colon as starting char.


Previous Comments:

[2008-12-18 02:54:25] ilatypov at infradead dot org

Description:

I accidentally commented out a line in php.ini with a hash mark instead of a 
semi-colon.  It appears that the php.ini parser does not raise an all-important 
alarm on this kind of error.  

I spent hours trying to understand why my changes to php.ini were not reflected 
in ini_get_all().

It would be nice if the php.ini parser threw a message about syntax errors to 
stderr.  Pretty please!









-- 
Edit this bug report at https://bugs.php.net/bug.php?id=46894&edit=1