#30699 [NEW]: make gethostbyname return error status in additional variables

2004-11-06 Thread [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Operating system: Irrelevant
PHP version:  4.3.9
PHP Bug Type: Feature/Change Request
Bug description:  make gethostbyname return error status in additional variables

Description:

It will be helpful to make gethostbyname return error status in additional
variables like fsockopen does for example in int errno, string errstr.

Now gethostbyname returns a string containing the unmodified hostname on
failure, but rather often it is desirable to know why the operation failed
and output standart system text error message without inventing own ones.
That way you can search information on internet with a higher probability
to find an answer in case of errors.

It should not be too difficult to implement since WSAGetLastError() from
WinSock2 returns generic error code and here you can find error code
descriptions. 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp

Expected result:

string gethostbyname ( string hostname[, int errno [, string errstr]] )

Actual result:
--
string gethostbyname ( string hostname )

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


#30700 [NEW]: Empty output using system(wrong string) function

2004-11-06 Thread igor dot makarov at mail dot ru
From: igor dot makarov at mail dot ru
Operating system: Linux 2.4.27
PHP version:  4.3.8
PHP Bug Type: Output Control
Bug description:  Empty output using system(wrong string) function

Description:

I make a code:
system('ls -gfjgsfl');

and I nothing see then as I read in manual: Execute an external program
and -display output-

In this situation then I use wrong unix command the system() function not
worked propertly.

I think what it's will be solved in next version...
I do not know how it's work under PHP5.

P.S.
With passthru() and exec() functions same problem :o(

Reproduce code:
---
?php

system('ls -gfjgsfl');
//nothing see

$_out = system('ls -gfjgsfl');
//still nothing see

?

Expected result:

/bin/ls: invalid option -- j
Try `/bin/ls --help' for more information.



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


#30701 [NEW]: RFE: Option to disable implicit conversion of integers to floats

2004-11-06 Thread os at sumu dot org
From: os at sumu dot org
Operating system: any
PHP version:  5.0.2
PHP Bug Type: Feature/Change Request
Bug description:  RFE: Option to disable implicit conversion of integers to floats

Description:

PHP implicitly converts integers to floats when they exceed MAX_LONG,
making implementing various algorithms in PHP quite difficult.  The change
in float-to-integer conversion in version 5.0.2 causes even more grief as
floats are now truncated.  An option for letting integers overflow instead
of converting them to floats would be great.  Or perhaps a set of functions
for doing integer-math.

Related bug reports: #18166, #30233, #30315, #30577, #30598.


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


#30702 [NEW]: cannot initialize class variable from class constant

2004-11-06 Thread douglass_davis at earthlink dot net
From: douglass_davis at earthlink dot net
Operating system: Windows XP
PHP version:  5.0.2
PHP Bug Type: Compile Failure
Bug description:  cannot initialize class variable from class constant

Description:

The manual says we can use constants in initializing class variables. 
However, this is not the case, as you cannot initialize variables to
constants that are defined in the same class.

When trying to compile it gives an error saying the class scope is not
active.  However, the constant is inside the class.

Also, it does not give the error where the class is defined, but when it
is instantiated.  So, perhaps it is an inlining error?

Maybe this is what's supposed to happen, if so, then the manual needs to
say that constants from the same class can't be used to initialize a var.

Reproduce code:
---
// This works:

class Constants
{
  const DEFAULT_SIZE=5;
}

class Square
{
  public $size=Constants::DEFAULT_SIZE;
}
$r= new Square();

// this doesn't

class Square2
{
  const DEFAULT_SIZE=5;
  public $size=self::DEFAULT_SIZE;
}

$r= new Square2();

Expected result:

I expect it to compile

Actual result:
--
PHP Fatal error:  Cannot access self:: when no class scope is active in
C:\src\test\consttest.php on line 23

Fatal error: Cannot access self:: when no class scope is active in
C:\src\test\consttest.php on line 23


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


#30703 [NEW]: Strange behaviour of mysqli_stmt_prepare()

2004-11-06 Thread khru3l at gmail dot com
From: khru3l at gmail dot com
Operating system: Windows XP Coporate + SP2
PHP version:  5.0.2
PHP Bug Type: MySQLi related
Bug description:  Strange behaviour of mysqli_stmt_prepare()

Description:

Enviroment: 
- Apache 2.0.52 + PHP 5.0.2 + MySQL 5.0.1a @ Windows XP + SP2


I am using the following MyISAM table, named poll_statistic:

CREATE TABLE poll_statistic (
pstat_Id MEDIUMINT(7) UNSIGNED NOT NULL AUTO_INCREMENT, 
pstat_Parent SMALLINT(5) UNSIGNED NOT NULL,
pstat_Ip VARCHAR(8) NOT NULL,
pstat_Date DATETIME DEFAULT '-00-00 00:00:00',
KEY key_Id (pstat_Id),
PRIMARY KEY(pstat_Ip, pstat_ParentId)
);

+--+--+--+-+
| pstat_Id | pstat_Parent | pstat_Ip | pstat_Date  | 
+--+--+--+-+
|1 |2 | 7f01 | 2004-11-06 12:19:57 |
|2 |4 | 7f01 | 2004-11-06 12:19:57 |
|3 |5 | 7f01 | 2004-11-06 12:19:57 |
|4 |7 | 7f01 | 2004-11-06 12:19:57 |
+--+--+--+-+

For the SAME sql query: SELECT pstat_Id FROM poll_statistic, I get two
different results. Using prepared statements the query returns 0 all the
time instead of the actual value hold by pstat_Id column. IF I change
the SQL Query to: SELECT pstat_Parent FROM poll_statistic or SELECT
pstat_Ip FROM poll_statistic everything works out fine. Back on selecting
pstat_Id, the returned value is 0. 

I'd really like to know if it's my fault or if there is a problem with
mysqli. I have restarted apache/mysql several times, but with the same
result.

Reproduce code:
---
?php
$mysqli = new mysqli(localhost, root, password, vote);
//Method I
$query = SELECT pstat_Id FROM poll_statistic;
if ($stmt = $mysqli-prepare($query)) {
   $stmt-execute();
   $stmt-bind_result($pid);
   while ($stmt-fetch()) { printf (%s\n, $pid); }   
   $stmt-close();
}   
//Method II
if ($result = $mysqli-query($query)) {
   while ($row = $result-fetch_array(MYSQLI_ASSOC)) {   
print_r($row); }
   $result-close();
}
$mysqli-close();

Expected result:

Method I:
1
2
3
4

Method II:
Array ( [pstat_Id] = 1 )
Array ( [pstat_Id] = 2 )
Array ( [pstat_Id] = 3 )
Array ( [pstat_Id] = 4 )

Actual result:
--
Method I:
0
0
0
0

Method II:
Array ( [pstat_Id] = 1 )
Array ( [pstat_Id] = 2 )
Array ( [pstat_Id] = 3 )
Array ( [pstat_Id] = 4 )

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


#30700 [Opn-Bgs]: Empty output using system(wrong string) function

2004-11-06 Thread tony2001
 ID:   30700
 Updated by:   [EMAIL PROTECTED]
 Reported By:  igor dot makarov at mail dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: Output Control
 Operating System: Linux 2.4.27
 PHP Version:  4.3.8
 New Comment:

Errors are written to error_log by default, so check out your Apache's
error log for them. If you really want to see error messages when using
system() - redirect stderr to stdout:
?php system (ls -j 21); ?


Previous Comments:


[2004-11-06 14:05:27] igor dot makarov at mail dot ru

Description:

I make a code:
system('ls -gfjgsfl');

and I nothing see then as I read in manual: Execute an external
program and -display output-

In this situation then I use wrong unix command the system() function
not worked propertly.

I think what it's will be solved in next version...
I do not know how it's work under PHP5.

P.S.
With passthru() and exec() functions same problem :o(

Reproduce code:
---
?php

system('ls -gfjgsfl');
//nothing see

$_out = system('ls -gfjgsfl');
//still nothing see

?

Expected result:

/bin/ls: invalid option -- j
Try `/bin/ls --help' for more information.







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


#18373 [Bgs]: unread_bytes always 0

2004-11-06 Thread techtonik
 ID:   18373
 Updated by:   [EMAIL PROTECTED]
 Reported By:  webmaster at darkenemy dot com
 Status:   Bogus
 Bug Type: Sockets related
 Operating System: Windows Server Platform
 PHP Version:  4.2.1
 New Comment:

feof() doesn't work with blocked sockets like flag for available data.
When it is time to see if more data is available and feof() returns
true that means that socket is actually closed.

Perhaps I can say where is a bug actually. When you write to a blocked
socket with fwrite() it resets internal socket buffer and the next
thing you'd like to know is when the data will be available. Now
there's no way to get that info. You can try to execute a read
operation and enter an endless loop waiting for the data to appear from
the other end until either script timeout happened or somebody will send
the data. 



Previous Comments:


[2002-10-05 09:12:29] [EMAIL PROTECTED]

unread_bytes is the number of bytes remaining in PHPs buffering layer
after the last read.
If you have consumed all data from the buffer on a prior read,
unread_bytes will remain at zero until you next read a chunk of data
from the network.
So, unread_bytes should not be used to determine if more data is
pending; you should use either:

a. feof() to detect end of file.
   Don't forget that you can use non-blocking mode here.

b. PHP 4.3 has a new function called stream_select() which
   behaves like socket_select() from the sockets extension,
   but works on all files returned by fopen() and
   fsockopen().  You can use it to test which files are
   ready for reading/writing and also specify a timeout.

PHP 4.3 is about to enter the release process, but you
can try a non-stable snapshot from
http://snaps.php.net/win32.
(It's probably best to wait a couple of hours, as some
important bug fixes have been made this morning).

--Wez.



[2002-09-25 09:25:10] webmaster at darkenemy dot com

I want to check the socket, whether there is data that must be read.
Otherwise the script should do other things. At moment the situation
is, that the script only can do other things, after read some data from
the socket. The most popular thing, that requires this mechanism, is to
write an IRC client with PHP, that can be used like cgi irc. Don't know
whether is possible with any current php build for Linux, under Windows
it wasn't possible with the builds from July 2002. I tried blocking and
non blocking mode, but the stream reseted. So I prefered blocking mode,
because the control about the socket is better.

The script only must know, whether there is data to read from the
socket, so that a request to the socket doesn't stop the script, until
there is some data.



[2002-09-25 09:19:07] [EMAIL PROTECTED]

Well, that depends on how you use the information. If the goal is to
detect a possible block(which looks like what your code is doing), then
when that value is 0, there is no data left on the socket. The same is
true if blocked is set, and if eof is set.

What would your reason be to look at the sytems buffer?

-Jason







[2002-09-11 11:47:26] webmaster at darkenemy dot com

Sorry, I had posted some more feedback. Don't know where it is now. So
I'll do again:

I tested that CVS build and the result was, that unread_bytes told me
the number of bytes, containing the PHP internal socket buffer and not
the number of bytes, available on that socket. And I think, that
unread_bytes should exactly mean that. Otherwise it would be some less
useful.



[2002-09-11 11:37:46] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18373

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


#30704 [NEW]: duplicate properties

2004-11-06 Thread info at rhalff dot com
From: info at rhalff dot com
Operating system: Linux
PHP version:  5.0.2
PHP Bug Type: Zend Engine 2 problem
Bug description:  duplicate properties

Description:

Property is declared twice, see below..

Reproduce code:
---
?php

abstract class Base {

private $var;

function __construct()
{
$this-initAttributes();
$this-doit();
}

final private function initAttributes( )
{
$this-var = false;
}

abstract protected function doit();


}

class Ext extends Base {

protected function doit()
{
  $this-var = 1;
}

}

class Bla {

static private $instance = false;

static function instance() {
Bla::$instance = new Ext();
return Bla::$instance;
}

}

$bla = Bla::instance();
var_dump($bla);
?

Expected result:

object(Ext)#1 (2) {
  [var:private]=
  int(1)
}


Actual result:
--
object(Ext)#1 (2) {
  [var:private]=
  bool(false)
  [var]=
  int(1)
}


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


#30704 [Opn-Bgs]: duplicate properties

2004-11-06 Thread helly
 ID:   30704
 Updated by:   [EMAIL PROTECTED]
 Reported By:  info at rhalff dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Zend Engine 2 problem
 Operating System: Linux
 PHP Version:  5.0.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


Previous Comments:


[2004-11-06 17:06:37] info at rhalff dot com

Description:

Property is declared twice, see below..

Reproduce code:
---
?php

abstract class Base {

private $var;

function __construct()
{
$this-initAttributes();
$this-doit();
}

final private function initAttributes( )
{
$this-var = false;
}

abstract protected function doit();


}

class Ext extends Base {

protected function doit()
{
  $this-var = 1;
}

}

class Bla {

static private $instance = false;

static function instance() {
Bla::$instance = new Ext();
return Bla::$instance;
}

}

$bla = Bla::instance();
var_dump($bla);
?

Expected result:

object(Ext)#1 (2) {
  [var:private]=
  int(1)
}


Actual result:
--
object(Ext)#1 (2) {
  [var:private]=
  bool(false)
  [var]=
  int(1)
}






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


#30703 [Opn-Bgs]: Strange behaviour of mysqli_stmt_prepare()

2004-11-06 Thread georg
 ID:   30703
 Updated by:   [EMAIL PROTECTED]
 Reported By:  khru3l at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: MySQLi related
 Operating System: Windows XP Coporate + SP2
 PHP Version:  5.0.2
 New Comment:

5.0.1a is a preview version and very old. Use the 5.0.2 
versions from bk tree or snaps.mysql.com. 
 
Works fine with MySQL 5.0.2: 
 
[EMAIL PROTECTED]:~/work/php/test php -f 30703.php 
1 
2 
3 
4 
Array 
( 
[pstat_Id] = 1 
) 
Array 
( 
[pstat_Id] = 2 
) 
Array 
( 
[pstat_Id] = 3 
) 
Array 
( 
[pstat_Id] = 4 
) 
 


Previous Comments:


[2004-11-06 15:35:54] khru3l at gmail dot com

Description:

Enviroment: 
- Apache 2.0.52 + PHP 5.0.2 + MySQL 5.0.1a @ Windows XP + SP2


I am using the following MyISAM table, named poll_statistic:

CREATE TABLE poll_statistic (
pstat_Id MEDIUMINT(7) UNSIGNED NOT NULL AUTO_INCREMENT, 
pstat_Parent SMALLINT(5) UNSIGNED NOT NULL,
pstat_Ip VARCHAR(8) NOT NULL,
pstat_Date DATETIME DEFAULT '-00-00 00:00:00',
KEY key_Id (pstat_Id),
PRIMARY KEY(pstat_Ip, pstat_ParentId)
);

+--+--+--+-+
| pstat_Id | pstat_Parent | pstat_Ip | pstat_Date  | 
+--+--+--+-+
|1 |2 | 7f01 | 2004-11-06 12:19:57 |
|2 |4 | 7f01 | 2004-11-06 12:19:57 |
|3 |5 | 7f01 | 2004-11-06 12:19:57 |
|4 |7 | 7f01 | 2004-11-06 12:19:57 |
+--+--+--+-+

For the SAME sql query: SELECT pstat_Id FROM poll_statistic, I get
two different results. Using prepared statements the query returns 0
all the time instead of the actual value hold by pstat_Id column. IF
I change the SQL Query to: SELECT pstat_Parent FROM poll_statistic or
SELECT pstat_Ip FROM poll_statistic everything works out fine. Back on
selecting pstat_Id, the returned value is 0. 

I'd really like to know if it's my fault or if there is a problem with
mysqli. I have restarted apache/mysql several times, but with the same
result.

Reproduce code:
---
?php
$mysqli = new mysqli(localhost, root, password, vote);
//Method I
$query = SELECT pstat_Id FROM poll_statistic;
if ($stmt = $mysqli-prepare($query)) {
   $stmt-execute();
   $stmt-bind_result($pid);
   while ($stmt-fetch()) { printf (%s\n, $pid); }   
   $stmt-close();
}   
//Method II
if ($result = $mysqli-query($query)) {
   while ($row = $result-fetch_array(MYSQLI_ASSOC)) {   
print_r($row); }
   $result-close();
}
$mysqli-close();

Expected result:

Method I:
1
2
3
4

Method II:
Array ( [pstat_Id] = 1 )
Array ( [pstat_Id] = 2 )
Array ( [pstat_Id] = 3 )
Array ( [pstat_Id] = 4 )

Actual result:
--
Method I:
0
0
0
0

Method II:
Array ( [pstat_Id] = 1 )
Array ( [pstat_Id] = 2 )
Array ( [pstat_Id] = 3 )
Array ( [pstat_Id] = 4 )





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


#30705 [NEW]: http://profic.boom.ru/002.html

2004-11-06 Thread barbos80 at list dot ru
From: barbos80 at list dot ru
Operating system: ïðîãðàììû
PHP version:  Irrelevant
PHP Bug Type: *Compile Issues
Bug description:  http://profic.boom.ru/002.html

Description:

Êàê çàðàáîòàòü îò 300$ â íåäåëþ!

Reproduce code:
---
çàðàáîòàòü,ðàñêðóòèòü,ðàáîòà,íîãî äåíåã

Expected result:

ðàáîòà

Actual result:
--
ðàñêðóòèòü

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


#30705 [Opn]: http://profic.boom.ru/002.html

2004-11-06 Thread barbos80 at list dot ru
 ID:   30705
 User updated by:  barbos80 at list dot ru
 Reported By:  barbos80 at list dot ru
 Status:   Open
 Bug Type: *Compile Issues
 Operating System: ïðîãðàììû
 PHP Version:  Irrelevant
 New Comment:

Ñàìûå íîâåéøèå ïðîãðàììû! Êàê çàðàáîòàòü îò 300$ â íåäåëþ!


Previous Comments:


[2004-11-06 17:34:50] barbos80 at list dot ru

Description:

Êàê çàðàáîòàòü îò 300$ â íåäåëþ!

Reproduce code:
---
çàðàáîòàòü,ðàñêðóòèòü,ðàáîòà,íîãî äåíåã

Expected result:

ðàáîòà

Actual result:
--
ðàñêðóòèòü





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


#30627 [Opn]: A userdata parameter for preg_replace_callback

2004-11-06 Thread [EMAIL PROTECTED]
 ID:   30627
 User updated by:  [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Irrelevant
 PHP Version:  Irrelevant
 New Comment:

The last parameter has to be $things, of course.


Previous Comments:


[2004-10-31 14:01:05] [EMAIL PROTECTED]

Description:

It would be nice if preg_replace_callback had a userdata parameter.

Example:
$string = [thing 1] foo [thing 2];
$things = array( 1 = One thing, 2 = Other thing);

function replace_callback($match, $data) {
return $data[$match[1]];
}

echo preg_replace_callback('/\[thing (\d+)\]/', 'replace_callback',
$string, -1, $data);

Would Output:
One thing foo Other thing






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


#30706 [NEW]: AND operator

2004-11-06 Thread kev at aero dot fr
From: kev at aero dot fr
Operating system: Win2003
PHP version:  5.0.2
PHP Bug Type: Math related
Bug description:  AND operator

Description:

php5 problem with and operator and big numbers

Reproduce code:
---
?
$c = 4023233417  2562383102;
echo $c;
// prints 2147483647
// the right answer is 2290649224 (good with php4)

?

Expected result:

the answer isn't good
the script prints 2147483647 and the right answer is 2290649224 


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


#30523 [Opn]: _GET bug with null last var persists

2004-11-06 Thread support at ruishi dot info
 ID:   30523
 User updated by:  support at ruishi dot info
 Reported By:  support at ruishi dot info
 Status:   Open
 Bug Type: URL related
 Operating System: Linux SUSE
 PHP Version:  4.3.9
 New Comment:

It turned out to be a bug of suphp... After upgrading it to
suphp-0.5.2, the problem is solved. Btw, I am running Apache2. No idea
if it works for Apache1, however no wonder if it does.

This bug can be closed now. I suggest doing so, thanks.


Previous Comments:


[2004-10-28 22:28:02] support at ruishi dot info

Hello, some investigation reveals that the hosting company has its
reasons to run it using the CGI API, mainly because of the security
related to multi hosting users. If PHP is run using the Apache API,
then every hosting user can view other users' file (e.g. config files
containing passwords).

This problem seems to have existed for extremely long time (several
years), hope it wouldn't stay there forever... No guru could get rid of
it?

Is there any way around? See, one normally has to host his files on an
ISP's machine, but PHP is usually installed using the CGI API because
of the security reason mentioned above. If $_GET does not work
(probably other $_VARs as well), then most php scripts would be broken.
How could the Web site survive?

Has anyone collected information about which OSes are free from this
bug? SUSE seems to be problematic, how about debian and else?



[2004-10-22 11:10:36] support at ruishi dot info

in the output of phpinfo(), there does exist a line Server API: CGI.
I will check with our sysadmin to see if we can solve it by making it
an Apache2 module. Stay tuned please. More comments and suggestions are
welcome.



[2004-10-22 00:57:24] scottm at spamcop dot net

We've had customers with a similar issue but never found out the cause
of it, we had null session paramaters in the query string if they were
using cookies but for some reason or another some hosts just didn't
work. We were never able to find out what caused this in the first
place.

I've just searched through a few of the previous support tickets and
they varied from PHP 4.3.1 to PHP 4.3.4. They all ran PHP as a CGI
though.

Do you run PHP as a CGI?



[2004-10-21 23:55:32] support at ruishi dot info

A typo in the submission (in the section of Expected Result):

--
For Link 2, the correct result should be:

Array ( [tid] = 123 [a] = 1 [b] = 2 [c] = 3 )
--

should be:

Array ( [tid] = 123 [a] = 1 [b] = 2 [c] = NULL or ''?)



[2004-10-21 23:19:42] support at ruishi dot info

Description:

The bug described earlier in http://bugs.php.net/bug.php?id=28221 by
some sir else still persists in PHP-4.3.9, Suse Linux. The problem is:

The request page.php?var1=avar2=bvar3=c sets the $_GET array
correctly, but a slightly different request
page.php?var1=avar2=bvar3= with a null $var3 will make the whole
$_GET array null!

A live demo can be found at:

Everything is fine with Link 1:
http://www.ruishi.info/forum/testwindnumeric.php?tid=123a=1b=2c=3

Then $_GET becomes null is the last variable $c is null in Link 2:
http://www.ruishi.info/forum/testwindnumeric.php?tid=123a=1b=2c=




Reproduce code:
---
$tid=?=$_GET['tid']?br
?php
require_once('./testglobal.php');
echo $tidbr;
echo $_GET['tid'];
echo \$_GET=;
print_r($_GET);
echo br;
if(!is_numeric($_GET['tid'])) echo('invalid id number');
?

In testglobal.php, the related sections:

print_r($_GET);
echo br;

unset($GLOBALS,$_ENV,$HTTP_ENV_VARS,$_REQUEST,$HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_POST_FILES,$HTTP_COOKIE_VARS);
$Is_Gmqgg=get_magic_quotes_gpc();
if(!$Is_Gmqgg){
Add_S($_POST);
Add_S($_GET);
Add_S($_COOKIE);
}
print_r($_GET);
echo br;
..

Expected result:

For Link 1, the result is correct.
For Link 2, the correct result should be:

Array ( [tid] = 123 [a] = 1 [b] = 2 [c] = 3 )

Actual result:
--
For Link 2, the actual incorrect result is:

Array ( )





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


#30541 [Bgs-Opn]: $php_errormsg isn't set when an error occured in a function called by eval()

2004-11-06 Thread php at dush dot student dot utwente dot nl
 ID:   30541
 User updated by:  php at dush dot student dot utwente dot nl
 Reported By:  php at dush dot student dot utwente dot nl
-Status:   Bogus
+Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: linux 2.6
 PHP Version:  5.0.2
 New Comment:

?
function bla3() {
echo $bla3;
var_dump($php_errormsg);
}
echo $bla2;
var_dump($php_errormsg);
eval('echo $bla1;');
var_dump($php_errormsg);
eval('bla3();');
var_dump($php_errormsg);
?
outputs:
Notice: Undefined variable: bla2 in /home/dush/public_html/test.php on
line 8
string(25) Undefined variable: bla2 
Notice: Undefined variable: bla1 in /home/dush/public_html/test.php(10)
: eval()'d code on line 1
string(25) Undefined variable: bla1 
Notice: Undefined variable: bla3 in /home/dush/public_html/test.php on
line 5
string(25) Undefined variable: bla3
string(25) Undefined variable: bla1 

It's certainly not a bug if it's supposed to be a different
$php_errormsg for every scope, but I thought it was a global variable.
If I'm not correct, please think of adding something like
$global_php_errormsg, as it would be very handy for debugging purposes
without having errors on possibly a lot of different positions on a
page with error_reporting(E_ALL);


Previous Comments:


[2004-11-04 13:43:17] [EMAIL PROTECTED]

Can't find any errors here:
?
eval('echo $blah;');
var_dump($php_errormsg);
echo $bla;
var_dump($php_errormsg);
?
outputs:
---
Notice: Undefined variable: blah in /www/index.php(3) : eval()'d code
on line 1
string(24) Undefined variable: blah 
Notice: Undefined variable: bla in /www/index.php on line 7
string(23) Undefined variable: bla
---
Check your code.



[2004-10-23 16:49:20] php at dush dot student dot utwente dot nl

Description:

in debug mode, my script stores every error that occured in the script.
when an error occurs in eval(), the error is stored correctly in
$php_errormsg. however when the error occured in a function called by
eval() the error isn't stored anymore.

Reproduce code:
---
register_tick_function(store_errors, true);
function store_errors($do_tick = true) {
GLOBAL $php_errormsg;
static $errors = array();
if ($do_tick) {
if (isset($php_errormsg)  $php_errormsg != ) {
if ($trace = debug_backtrace()) {
$func = $trace[1]['function'];
if (isset($trace[1]['class']))
$func = 
$trace[1]['class'].$trace[1]['type'].$func;
}else {
$func = 'unknown';
}
$errors[] = array(
0 = $php_errormsg,
1 = $func
);
$php_errormsg = ;
}
}else {
return $errors;
}
}
/* stupid test function */
function blah() { echo $blah2; echo error is set here:
$php_errormsgbr; }
eval ('echo $blah1; blah();');
$ar = store_errors(false);
while(list($key,$val) = each($ar)) {
echo {$key} = {$val[0]} in {$val[1]}br\n;
}

Expected result:

Notice: Undefined variable: blah1 in
/home/dush/public_html/core/loader.inc.php(28) : eval()'d code on line
1

Notice: Undefined variable: blah2 in
/home/dush/public_html/core/loader.inc.php on line 27
error is set here: Undefined variable: blah2
0 = Undefined variable: blah1 in unknown
1 = Undefined variable: blah2 in blah

Actual result:
--
Notice: Undefined variable: blah1 in
/home/dush/public_html/core/loader.inc.php(28) : eval()'d code on line
1

Notice: Undefined variable: blah2 in
/home/dush/public_html/core/loader.inc.php on line 27
error is set here: Undefined variable: blah2
0 = Undefined variable: blah1 in unknown





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


#30705 [Opn-Bgs]: -

2004-11-06 Thread derick
 ID:   30705
 Updated by:   [EMAIL PROTECTED]
-Summary:  http://profic.boom.ru/002.html
 Reported By:  barbos80 at list dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: *Compile Issues
-Operating System: ïðîãðàììû
+Operating System: ���������
 PHP Version:  Irrelevant
 New Comment:

We only handle bug reports in English


Previous Comments:


[2004-11-06 17:39:48] barbos80 at list dot ru

Ñàìûå íîâåéøèå ïðîãðàììû! Êàê çàðàáîòàòü îò 300$ â íåäåëþ!



[2004-11-06 17:34:50] barbos80 at list dot ru

Description:

Êàê çàðàáîòàòü îò 300$ â íåäåëþ!

Reproduce code:
---
çàðàáîòàòü,ðàñêðóòèòü,ðàáîòà,íîãî äåíåã

Expected result:

ðàáîòà

Actual result:
--
ðàñêðóòèòü





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


#30523 [Opn-Bgs]: _GET bug with null last var persists

2004-11-06 Thread derick
 ID:   30523
 Updated by:   [EMAIL PROTECTED]
 Reported By:  support at ruishi dot info
-Status:   Open
+Status:   Bogus
 Bug Type: URL related
 Operating System: Linux SUSE
 PHP Version:  4.3.9
 New Comment:

Not a bug in PHP - bogus.


Previous Comments:


[2004-11-06 20:13:01] support at ruishi dot info

It turned out to be a bug of suphp... After upgrading it to
suphp-0.5.2, the problem is solved. Btw, I am running Apache2. No idea
if it works for Apache1, however no wonder if it does.

This bug can be closed now. I suggest doing so, thanks.



[2004-10-28 22:28:02] support at ruishi dot info

Hello, some investigation reveals that the hosting company has its
reasons to run it using the CGI API, mainly because of the security
related to multi hosting users. If PHP is run using the Apache API,
then every hosting user can view other users' file (e.g. config files
containing passwords).

This problem seems to have existed for extremely long time (several
years), hope it wouldn't stay there forever... No guru could get rid of
it?

Is there any way around? See, one normally has to host his files on an
ISP's machine, but PHP is usually installed using the CGI API because
of the security reason mentioned above. If $_GET does not work
(probably other $_VARs as well), then most php scripts would be broken.
How could the Web site survive?

Has anyone collected information about which OSes are free from this
bug? SUSE seems to be problematic, how about debian and else?



[2004-10-22 11:10:36] support at ruishi dot info

in the output of phpinfo(), there does exist a line Server API: CGI.
I will check with our sysadmin to see if we can solve it by making it
an Apache2 module. Stay tuned please. More comments and suggestions are
welcome.



[2004-10-22 00:57:24] scottm at spamcop dot net

We've had customers with a similar issue but never found out the cause
of it, we had null session paramaters in the query string if they were
using cookies but for some reason or another some hosts just didn't
work. We were never able to find out what caused this in the first
place.

I've just searched through a few of the previous support tickets and
they varied from PHP 4.3.1 to PHP 4.3.4. They all ran PHP as a CGI
though.

Do you run PHP as a CGI?



[2004-10-21 23:55:32] support at ruishi dot info

A typo in the submission (in the section of Expected Result):

--
For Link 2, the correct result should be:

Array ( [tid] = 123 [a] = 1 [b] = 2 [c] = 3 )
--

should be:

Array ( [tid] = 123 [a] = 1 [b] = 2 [c] = NULL or ''?)



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/30523

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


#30707 [NEW]: Segmentation fault

2004-11-06 Thread guth at fiifo dot u-psud dot fr
From: guth at fiifo dot u-psud dot fr
Operating system: Linux
PHP version:  5.0.2
PHP Bug Type: Zend Engine 2 problem
Bug description:  Segmentation fault

Description:

I get another segmentation fault... 
You can look at the reproduce code. 

Reproduce code:
---
?php

class B {

public function plip() {

try {
$this-plap($this-plop());
}
catch(Exception $e) {
}

}

public function plap($a) {
}

public function plop() {
throw new Exception;
}

}

class C {

public function __construct() {

$b = new B;
$this-byePHP($b-plip());

}

public function byePHP($plop) {
echo www.haricow.org;
}

}

new C;
?

Expected result:

www.haricow.org 

Actual result:
--
Program received signal SIGSEGV, Segmentation fault. 
[Switching to Thread 1075737248 (LWP 3881)] 
0x403d2373 in zend_do_fcall_common_helper 
(execute_data=0xbfffccd0, opline=0x8170c64, 
op_array=0x816f784) 
at /usr/src/php5/Zend/zend_execute.c:2656 
2656if 
(EX(function_state).function-common.fn_flags  
ZEND_ACC_ABSTRACT) { 
(gdb) bt 
#0  0x403d2373 in zend_do_fcall_common_helper 
(execute_data=0xbfffccd0, opline=0x8170c64, 
op_array=0x816f784) 
at /usr/src/php5/Zend/zend_execute.c:2656 
#1  0x403d2c63 in zend_do_fcall_by_name_handler 
(execute_data=0xbfffccd0, opline=0x8170c64, 
op_array=0x816f784) 
at /usr/src/php5/Zend/zend_execute.c:2825 
#2  0x403cebee in execute (op_array=0x816f784) at 
/usr/src/php5/Zend/zend_execute.c:1400 
#3  0x403d2791 in zend_do_fcall_common_helper 
(execute_data=0xbfffce20, opline=0x816b694, 
op_array=0x816706c) 
at /usr/src/php5/Zend/zend_execute.c:2740 
#4  0x403d2c63 in zend_do_fcall_by_name_handler 
(execute_data=0xbfffce20, opline=0x816b694, 
op_array=0x816706c) 
at /usr/src/php5/Zend/zend_execute.c:2825 
#5  0x403cebee in execute (op_array=0x816706c) at 
/usr/src/php5/Zend/zend_execute.c:1400 
#6  0x403a9f5d in zend_execute_scripts (type=8, 
retval=0x0, file_count=3) 
at /usr/src/php5/Zend/zend.c:1060 
#7  0x40362a94 in php_execute_script 
(primary_file=0xb190) at 
/usr/src/php5/main/main.c:1628 
#8  0x403dab14 in apache_php_module_main (r=0x815c29c, 
display_source_mode=0) 
at /usr/src/php5/sapi/apache/sapi_apache.c:54 
#9  0x403dba9f in send_php (r=0x815c29c, 
display_source_mode=0, filename=0x815cda4 /www/test.php) 
at /usr/src/php5/sapi/apache/mod_php5.c:622 
#10 0x403dbb18 in send_parsed_php (r=0x815c29c) at 
/usr/src/php5/sapi/apache/mod_php5.c:637 
#11 0x08071e77 in ap_invoke_handler () 
#12 0x08086ebd in process_request_internal () 
#13 0x08086f1c in ap_process_request () 
#14 0x0807df40 in child_main () 
#15 0x0807e0e8 in make_child () 
#16 0x0807e24e in startup_children () 
#17 0x0807e90e in standalone_main () 
#18 0x0807f12c in main () 

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


#30708 [NEW]: Stream of type 'STDIO' was not closed

2004-11-06 Thread guth at fiifo dot u-psud dot fr
From: guth at fiifo dot u-psud dot fr
Operating system: Linux
PHP version:  5.0.2
PHP Bug Type: Zend Engine 2 problem
Bug description:  Stream of type 'STDIO' was not closed

Description:

hello, 
 
It seems that PHP doesn't close a Stream of type 'STDIO' 
when the PHP code produces a parse error with throw. 

Reproduce code:
---
?php
strlen(throw new Exception);
?

Expected result:

/www/test2.php(2) : Parse error - parse error, unexpected 
T_THROW, expecting ')' 

Actual result:
--
/www/test2.php(2) : Parse error - parse error, unexpected 
T_THROW, expecting ')' 
 
/usr/src/php5/main/streams/streams.c(375) : Stream of type 
'STDIO' 0x816d83c (path:/www/test2.php) was not closed 

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


#30615 [Fbk-NoF]: Fatal error: Call to undefined function: onselect()

2004-11-06 Thread php-bugs
 ID:   30615
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dmitryseliv at yahoo dot com
-Status:   Feedback
+Status:   No Feedback
 Bug Type: Class/Object related
 Operating System: Red Hat Linux
 PHP Version:  4.3.9
 New Comment:

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.


Previous Comments:


[2004-10-30 00:54:42] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to Open.

Thank you for your interest in PHP.




[2004-10-29 20:05:41] dmitryseliv at yahoo dot com

Description:

Hi! We just upgraded php to 4.3.9 and i'm getting this error message
right now. Code looks fine.
So my guess it's some how related to the upgraded.



Reproduce code:
---
function select()
{
$this-onSelect();
$objDB = createDataBase();
$sOrderBy = getValue(order_by, $GLOBALS[Variables]);
if ($sOrderBy != )
{
$vtrFieldArray = getValue($sOrderBy, $this-m_vtrFields);
if (gettype($vtrFieldArray) == 'array')
{
$sOrderBy =  order by .($vtrFieldArray[1]). asc;
}
else
{
$sOrderBy = ;
}   
}
$sRequest = select ;
for ($nCount = 0; $nCount  count($this-m_vtrFields);
++$nCount)
{
if ($nCount != 0)
{
$sRequest .=  , ;
}
$sRequest .= $this-m_vtrFields[$nCount][1];
}
$sRequest .=  from ;
for ($nCount = 0; $nCount  count($this-m_vtrTables);
++$nCount)
{
if ($nCount != 0)
{
$sRequest .=  , ;
}
$sRequest .= $this-m_vtrTables[$nCount];
}
if (($this-m_nID != ) || ($this-m_sWhereClause != ))
{   
$sRequest .=  where ;
}   
if ($this-m_nID != )
{
$sRequest .=  .$this-m_vtrTables[0]..id=.$this-m_nID;
if ($this-m_sWhereClause != )
{
$sRequest .=  and ;
}
}

if ($this-m_sGroupClause != )
{   
$sRequest .= $this-m_sGroupClause;
}

$sRequest .= $this-m_sWhereClause;
$sRequest .= $sOrderBy;


$this-m_vtrResultTable = $objDB-execute($sRequest);
}

Actual result:
--
Fatal error: Call to undefined function: onselect() 





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


#30541 [Opn]: $php_errormsg isn't set when an error occured in a function called by eval()

2004-11-06 Thread php at dush dot student dot utwente dot nl
 ID:   30541
 User updated by:  php at dush dot student dot utwente dot nl
 Reported By:  php at dush dot student dot utwente dot nl
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: linux 2.6
 PHP Version:  5.0.2
 New Comment:

and sorry, forgot to notice, I know of set_error_handler() :-)


Previous Comments:


[2004-11-06 22:38:02] php at dush dot student dot utwente dot nl

?
function bla3() {
echo $bla3;
var_dump($php_errormsg);
}
echo $bla2;
var_dump($php_errormsg);
eval('echo $bla1;');
var_dump($php_errormsg);
eval('bla3();');
var_dump($php_errormsg);
?
outputs:
Notice: Undefined variable: bla2 in /home/dush/public_html/test.php on
line 8
string(25) Undefined variable: bla2 
Notice: Undefined variable: bla1 in /home/dush/public_html/test.php(10)
: eval()'d code on line 1
string(25) Undefined variable: bla1 
Notice: Undefined variable: bla3 in /home/dush/public_html/test.php on
line 5
string(25) Undefined variable: bla3
string(25) Undefined variable: bla1 

It's certainly not a bug if it's supposed to be a different
$php_errormsg for every scope, but I thought it was a global variable.
If I'm not correct, please think of adding something like
$global_php_errormsg, as it would be very handy for debugging purposes
without having errors on possibly a lot of different positions on a
page with error_reporting(E_ALL);



[2004-11-04 13:43:17] [EMAIL PROTECTED]

Can't find any errors here:
?
eval('echo $blah;');
var_dump($php_errormsg);
echo $bla;
var_dump($php_errormsg);
?
outputs:
---
Notice: Undefined variable: blah in /www/index.php(3) : eval()'d code
on line 1
string(24) Undefined variable: blah 
Notice: Undefined variable: bla in /www/index.php on line 7
string(23) Undefined variable: bla
---
Check your code.



[2004-10-23 16:49:20] php at dush dot student dot utwente dot nl

Description:

in debug mode, my script stores every error that occured in the script.
when an error occurs in eval(), the error is stored correctly in
$php_errormsg. however when the error occured in a function called by
eval() the error isn't stored anymore.

Reproduce code:
---
register_tick_function(store_errors, true);
function store_errors($do_tick = true) {
GLOBAL $php_errormsg;
static $errors = array();
if ($do_tick) {
if (isset($php_errormsg)  $php_errormsg != ) {
if ($trace = debug_backtrace()) {
$func = $trace[1]['function'];
if (isset($trace[1]['class']))
$func = 
$trace[1]['class'].$trace[1]['type'].$func;
}else {
$func = 'unknown';
}
$errors[] = array(
0 = $php_errormsg,
1 = $func
);
$php_errormsg = ;
}
}else {
return $errors;
}
}
/* stupid test function */
function blah() { echo $blah2; echo error is set here:
$php_errormsgbr; }
eval ('echo $blah1; blah();');
$ar = store_errors(false);
while(list($key,$val) = each($ar)) {
echo {$key} = {$val[0]} in {$val[1]}br\n;
}

Expected result:

Notice: Undefined variable: blah1 in
/home/dush/public_html/core/loader.inc.php(28) : eval()'d code on line
1

Notice: Undefined variable: blah2 in
/home/dush/public_html/core/loader.inc.php on line 27
error is set here: Undefined variable: blah2
0 = Undefined variable: blah1 in unknown
1 = Undefined variable: blah2 in blah

Actual result:
--
Notice: Undefined variable: blah1 in
/home/dush/public_html/core/loader.inc.php(28) : eval()'d code on line
1

Notice: Undefined variable: blah2 in
/home/dush/public_html/core/loader.inc.php on line 27
error is set here: Undefined variable: blah2
0 = Undefined variable: blah1 in unknown





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


#30709 [NEW]: preg_replace() and /e modifier not working with classes

2004-11-06 Thread cristian dot melendez at gmail dot com
From: cristian dot melendez at gmail dot com
Operating system: Windows XP
PHP version:  5.0.1
PHP Bug Type: Regexps related
Bug description:  preg_replace() and /e modifier not working with classes

Description:

i'm using preg_replace() with the /e modifier to force php code to be run
at the replacement.

preg_replace() and /e won't work if, instead of a regular function, i use
a class object.

Reproduce code:
---
code shown in http://www.php.net/preg_replace
?php
preg_replace(/(\/?)(\w+)([^]*)/e, 
 '\\1' . strtoupper('\\2') . '\\3', 
 $html_body);
?

my code:
?php
 $someclass = new someclass();
preg_replace(/(\/?)(\w+)([^]*)/e, 
 '\\1' . $someclass-somefunction('\\2') . '\\3', 
 $html_body);
?

Expected result:

preg_replace ignores $someclass-somefunction() and just returns the text.


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


#30710 [NEW]: Client Version is too old

2004-11-06 Thread philip at r66 dot ru
From: philip at r66 dot ru
Operating system: Windows XP Pro
PHP version:  4.3.9
PHP Bug Type: MySQL related
Bug description:  Client Version is too old

Description:

MySQL Returns error #1251 - Client does not support authentication
protocol requested by server; consider upgrading MySQL client;


MySQL Version 4.1.7-nt

Apache Version: Apache/2.0.52 (Win32)

Current Client API version:  3.23.49 (what phpinfo() tells)


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


#30710 [Opn-Bgs]: Client Version is too old

2004-11-06 Thread derick
 ID:   30710
 Updated by:   [EMAIL PROTECTED]
 Reported By:  philip at r66 dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: MySQL related
 Operating System: Windows XP Pro
 PHP Version:  4.3.9
 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. 

Thank you for your interest in PHP.

.


Previous Comments:


[2004-11-07 07:07:08] philip at r66 dot ru

Description:

MySQL Returns error #1251 - Client does not support authentication
protocol requested by server; consider upgrading MySQL client;


MySQL Version 4.1.7-nt

Apache Version: Apache/2.0.52 (Win32)

Current Client API version:  3.23.49 (what phpinfo() tells)






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



#30709 [Opn-Bgs]: preg_replace() and /e modifier not working with classes

2004-11-06 Thread derick
 ID:   30709
 Updated by:   [EMAIL PROTECTED]
 Reported By:  cristian dot melendez at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Regexps related
 Operating System: Windows XP
 PHP Version:  5.0.1
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


Previous Comments:


[2004-11-07 05:50:01] cristian dot melendez at gmail dot com

Description:

i'm using preg_replace() with the /e modifier to force php code to be
run at the replacement.

preg_replace() and /e won't work if, instead of a regular function, i
use a class object.

Reproduce code:
---
code shown in http://www.php.net/preg_replace
?php
preg_replace(/(\/?)(\w+)([^]*)/e, 
 '\\1' . strtoupper('\\2') . '\\3', 
 $html_body);
?

my code:
?php
 $someclass = new someclass();
preg_replace(/(\/?)(\w+)([^]*)/e, 
 '\\1' . $someclass-somefunction('\\2') . '\\3', 
 $html_body);
?

Expected result:

preg_replace ignores $someclass-somefunction() and just returns the
text.






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