php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30582 Accessing a static method from a static method in class doesn't work
Submitted: 2004-10-27 14:19 UTC Modified: 2004-11-14 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jj at archit dot uni-karlsruhe dot de Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 4.3.9 OS: Debian Woody R3
Private report: No CVE-ID: None
 [2004-10-27 14:19 UTC] jj at archit dot uni-karlsruhe dot de
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 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-04 11:10 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


 [2004-11-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC