ID:               39852
 Updated by:       [EMAIL PROTECTED]
 Reported By:      eingmarra at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: windowsxp sp2
 PHP Version:      5.2.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2006-12-16 12:29:11] eingmarra at hotmail dot com

Description:
------------
Hi Master!
I used php5.2 to write a class for some needs, I was surperised to find
the static variable worked in an abnormal way, so I need you help to
test it!

--- test.php
<?php
class JavaBridgeLoader {
        private static $configedFlag = false;
        const jar_path = "jar/";
                
    public static function preConfig(){
        var_dump(self::$configedFlag);
        if(self::$configedFlag == false){
                //exec('java -jar '. self::jar_path. '"JavaBridge.jar"
SERVLET:8080');
                
                self::$configedFlag = true;
        }
        var_dump(self::$configedFlag);
    }   
}
JavaBridgeLoader::preconfig();
?>


I expect for the result is "bool(false) bool(true) at the first time,
And then: bool(true) bool(true) at the second time"

I am not a phper, I am a java liker and want to learn the php lanugage,
I dont know why it can not performence like java performence, So I
report this bug!

Thank you and hoping for you responsing...
And best Regards to you all!



Reproduce code:
---------------
<?php
class JavaBridgeLoader {
        private static $configedFlag = false;
        const jar_path = "jar/";
                
    public static function preConfig(){
        var_dump(self::$configedFlag);
        if(self::$configedFlag == false){
                //exec('java -jar '. self::jar_path. '"JavaBridge.jar"
SERVLET:8080');
                
                self::$configedFlag = true;
        }
        var_dump(self::$configedFlag);
    }   
}
JavaBridgeLoader::preconfig();
?>

Expected result:
----------------
bool(false) bool(true) ---- the first time 

bool(true) bool(true)  ---- the second time

Actual result:
--------------
bool(false) bool(true) ---- the first time 

bool(false) bool(true)  ---- the second time


------------------------------------------------------------------------


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

Reply via email to