ID:               29613
 User updated by:  onebird at 21cn dot com
 Reported By:      onebird at 21cn dot com
 Status:           Open
 Bug Type:         Zend Engine 2 problem
 Operating System: win2k
 PHP Version:      5.0.0
 New Comment:

if I used an object to $DB , like :
$a = new system_login ($Global_DB_Connection, "Form");
I found the "Form" can't transfer to $mode also !


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

[2004-08-11 16:49:57] onebird at 21cn dot com

More for code :

// file base.inc
<?php
class Base
{ var $test;
  var $info;
 function test()
  { //...anything..
  }
}
?>
//this is other file
<?php
require_once("base.inc");
class system_login extends Base
{
   private $db_conn; 
   private $user_table = 'user';
  function system_login( $DB = "", $mode = "http" )
  {
  global $Global_DB_Connection;
   if (empty($DB)) 
    $this->db_conn = $Global_DB_Connection;
   else
    $this->db_conn = $DB;
   if ($mode == 'http')
    {
    if (!isset($_SERVER['PHP_AUTH_USER'])) {
   header('WWW-Authenticate: Basic realm="My Realm"');
   header('HTTP/1.0 401 Unauthorized');
   echo 'please login at first !';
   exit;
  } else {
   Base::sys_login($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
   // ...anything..
  }
  }
 else
{
//... something for Form submit to login ...
}  
}
}

$a = new system_login ("","Form");
?>

if changed the :
function system_login( $DB = "", $mode = "http" )
to
function system_login( $DB, $mode )
used the
$a = new system_login ("","Form");
or
$a = new system_login ("","");

The PHP5 told me all the parameters missing !!

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

[2004-08-11 13:41:27] [EMAIL PROTECTED]

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-08-11 13:33:09] onebird at 21cn dot com

Description:
------------
construct Class error when used 2 parameters or more ;

The first parameter can't used the Default value !!


Reproduce code:
---------------
class Base
{.....}
class system_login extends Base
{
   var $db_conn; 
   var $user_table = 'user';
  function system_login( $DB = "", $mode = "http" )
  {.....}
}
$a = new system_login ("","Form");

Expected result:
----------------
I found the $mode == "http" always ;
but it will be $mode == "Form" when construct this class;

if I used :    $a = new system_login ("ss","Form");
the $mode == "Form" is OK!

The first parameter can't used the Default value !!

this code can used under PHP4 , it OK always !



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


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

Reply via email to