From:             jj at archit dot uni-karlsruhe dot de
Operating system: Debian Woody R3
PHP version:      4.3.9
PHP Bug Type:     Class/Object related
Bug description:  Accessing a static method from a static method in class doesn't work

Description:
------------
When trying to call a static method from within another 
static method in the same class, PHP fails and prints 
"Problem with method call - please report this bug". 
However, in a couple of other methods, this does work. I 
have no clue, why it doesn't work in this particular 
function, though. 

Reproduce code:
---------------
function _getAuthType( ) {
if (  strstr( $_POST["username"], "tmp_" ) || 
(isset( $_SESSION["wahl"] ) && strstr( $_SESSION["wahl"] -> username,
"tmp_" ) ) ) {
return "DB";
} else {
return "LDAP";
}
} /* end of getAuthType */
function getAuthOpts( ) {
$this -> authOpts = array( "DB"  => array("dsn" =>
DB_DRIVER."://".STUD_DB_USER.":".STUD_DB_PASS."@".STUD_DB_HOST."/".STUD_DB_NAME,
"cryptType"=> "none",
"table" => "studis",
"usernamecol" => "login",
"passwordcol" => "matrikelnr" ),
"LDAP" => array( 
"host"=> "ldaps://<host>", 
"port"=> 636,
"basedn"=> "<dn>",
"userattr"=> "uid" )
);
$authType = WahlApplication::_getAuthType( );
return $this -> authOpts[ $authType ];
}

Expected result:
----------------
$authType should contain a string - either "DB" or "LDAP" 

Actual result:
--------------
Warning: Problem with method call - please report this bug 
in /home/www/arch/studwahl-test/inc/base_classes.php on 
line 76 
  
 Fatal error: Call to a member function on a non-object 
in /home/www/arch/studwahl-test/inc/base_classes.php on 
line 88 

-- 
Edit bug report at http://bugs.php.net/?id=30582&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30582&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30582&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30582&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30582&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30582&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30582&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30582&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30582&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30582&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30582&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30582&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30582&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30582&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30582&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30582&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30582&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30582&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30582&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30582&r=mysqlcfg

Reply via email to