#43702 [NEW]: Operator precedence problem

2007-12-29 Thread gdiego at gmail dot com
From: gdiego at gmail dot com
Operating system: Irrelevant
PHP version:  5.2.5
PHP Bug Type: Arrays related
Bug description:  Operator precedence problem

Description:

So, this is not really a bug itself but it's a problem.
Let's say we have:

class a {
  var $a = array('a'=1);
[...] some functions [...]
};

Lets say a function inside the class does:
var_dump($this-a); //this will dump $a array of class a.
If we do var_dump($this-a['a']) it will dump integer 1.
If we do:
$z=a; var_dump($this-$z); it will dump $a array of class a.
Since here all is working fine because $z is used as a pointer.
What happens with?
$z=a; var_dump($this-$z['a']);
So, this will again dump the $a array in the class.

The problem here is the following, because of the operator precedence, the
index ['a'] is considered an index of $z which is a string. Then 'a' is
casted to integer and interpreted as 0.
$this-$z['a'] becomes the same as $this-$z[0] and, as $z[0] is 'a', this
becomes $this-a (the array).

This is not really a problem (even its not clear this precedence in the
documentation as posted in other bug).
My problem is that I couldn't find any way of telling the php interpreter
that ['a'] should be considered as an index for the whole expression.

($this-$a)['a'] gives syntax error and I have been trying to find a way
to do this without intermediate variables and couldn't figure out a
solution.

I know this example has no sense (who would really do this?) but still
think there should be a way to specify the precedence (and if there is, it
should be documentated in the operator precedence page, which lacks of the
- operator by the way).

Thanks,
Diego



-- 
Edit bug report at http://bugs.php.net/?id=43702edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43702r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43702r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43702r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43702r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43702r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43702r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43702r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43702r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43702r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43702r=support
Expected behavior:http://bugs.php.net/fix.php?id=43702r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43702r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43702r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43702r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43702r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43702r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43702r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43702r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43702r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43702r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43702r=mysqlcfg


#43683 [Opn-Bgs]: Can not find oci.dll and uninstall

2007-12-29 Thread derick
 ID:   43683
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ranlicmu at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *Configuration Issues
 Operating System: windows xp
 PHP Version:  5.2.5
 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:


[2007-12-27 02:07:17] ranlicmu at gmail dot com

Description:

Can not open any php file. The following dll fills are missing: oci.dll
sqlite3.dll aspell-15.dll libcs.dll db2cli.dll isqlt09a.dll
libsqldbc_c.dll libmonetra.dll lcrzo.dll ociw32.dll db2cli.dll
iclit09b.dll intl3_svn.dll. Can not change and uninstall in the original
installer.






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


#43690 [Opn]: sprintf returning unexpected number

2007-12-29 Thread derick
 ID:   43690
 Updated by:   [EMAIL PROTECTED]
 Reported By:  yardgnomeray at gmail dot com
 Status:   Open
 Bug Type: Strings related
 Operating System: Windows XP SP2
 PHP Version:  5.2.5
 New Comment:

@felipe... you're wrong here - this works just fine without having to
cast to float:

[EMAIL PROTECTED]:~$ php-5.2.5RC2 

?php
$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
$address = sprintf(IP ADDR = %u, $ipaddr);
echo $address;
?

IP ADDR = 3574256784d


Previous Comments:


[2007-12-28 14:46:42] [EMAIL PROTECTED]

Ops, ignore the part ip2long() returns a string.



[2007-12-28 14:45:19] [EMAIL PROTECTED]

ip2long() returns a string. Converting this value to float for obtain
large precision, you will have the expected result.

$ip = 213.10.212.144;
$ipaddr = sprintf(%u, ip2long($ip));
$address = sprintf(IP ADDR = %u, (float) $ipaddr);

var_dump(PHP_INT_MAX, ip2long($ip), $ipaddr, $address);

--
int(2147483647)
int(-720710512)
string(10) 3574256784
string(20) IP ADDR = 3574256784



[2007-12-27 16:24:54] yardgnomeray at gmail dot com

Description:

Using integer = 2147483647 for a %u or %d will return 2147483647

Reproduce code:
---
$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
$address = sprintf(IP ADDR = %u, $ipaddr);
echo $address;

Expected result:

IP ADDR = 3574256784

Actual result:
--
IP ADDR = 2147483647





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


#43701 [Opn-WFx]: New PHP File Type

2007-12-29 Thread derick
 ID:  43701
 Updated by:  [EMAIL PROTECTED]
 Reported By: dagdamor at simps dot ru
-Status:  Open
+Status:  Wont fix
 Bug Type:Feature/Change Request
 PHP Version: 6CVS-2007-12-29 (CVS)
 New Comment:

I don't see why this is useful at all, just add the tags.


Previous Comments:


[2007-12-29 05:39:47] dagdamor at simps dot ru

Description:

What about new file type (extension) for PHP? :)

Say, .psc (PHP Source Code). The only difference from .php is that it
wouldn't recognize ?php ... ? tags at all, and would only work as pure
PHP code. Would be very useful for serious projects, like PHP
frameworks, that don't need HTML embedding, and use template systems
instead.

Cheers,
Dagdamor






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


#43703 [NEW]: Signature compatibility check broken for namespaces

2007-12-29 Thread [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Operating system: Irrelevant
PHP version:  5.3CVS-2007-12-29 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description:  Signature compatibility check broken for namespaces

Description:

When a namespaced class extends an namespaced abstract class, the
signature compatiblity check breaks.

Reproduce code:
---
test.php
?php
require 'joinpoint.php';
require 'pointcut.php';
require 'read.php';

joinpoint.php
?php
namespace GAP;

class JoinPoint
{
}

pointcut.php
?php
namespace GAP;

abstract class Pointcut
{
abstract public function evaluate(JoinPoint $joinPoint);
}

read.php
?php
namespace GAP::Pointcut::Attribute;

use GAP::Joinpoint;
use GAP::Pointcut;

class Read extends Pointcut
{
public function evaluate(JoinPoint $joinPoint)
{
}
}

Expected result:

No syntax error.

Actual result:
--
Fatal error: Declaration of GAP::Pointcut::Attribute::Read::evaluate()
must be compatible with that of GAP::Pointcut::evaluate() in
/home/sb/read.php on line 12

-- 
Edit bug report at http://bugs.php.net/?id=43703edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43703r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43703r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43703r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43703r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43703r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43703r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43703r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43703r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43703r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43703r=support
Expected behavior:http://bugs.php.net/fix.php?id=43703r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43703r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43703r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43703r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43703r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43703r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43703r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43703r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43703r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43703r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43703r=mysqlcfg


#43690 [Opn]: sprintf returning unexpected number

2007-12-29 Thread felipe
 ID:   43690
 Updated by:   [EMAIL PROTECTED]
 Reported By:  yardgnomeray at gmail dot com
 Status:   Open
 Bug Type: Strings related
 Operating System: Windows XP SP2
 PHP Version:  5.2.5
 New Comment:

I'm using PHP 5.3.0-dev (cli) (built: Dec 25 2007 10:07:55), and the
convertion was necessary.


Previous Comments:


[2007-12-29 10:22:44] [EMAIL PROTECTED]

@felipe... you're wrong here - this works just fine without having to
cast to float:

[EMAIL PROTECTED]:~$ php-5.2.5RC2 

?php
$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
$address = sprintf(IP ADDR = %u, $ipaddr);
echo $address;
?

IP ADDR = 3574256784d



[2007-12-28 14:46:42] [EMAIL PROTECTED]

Ops, ignore the part ip2long() returns a string.



[2007-12-28 14:45:19] [EMAIL PROTECTED]

ip2long() returns a string. Converting this value to float for obtain
large precision, you will have the expected result.

$ip = 213.10.212.144;
$ipaddr = sprintf(%u, ip2long($ip));
$address = sprintf(IP ADDR = %u, (float) $ipaddr);

var_dump(PHP_INT_MAX, ip2long($ip), $ipaddr, $address);

--
int(2147483647)
int(-720710512)
string(10) 3574256784
string(20) IP ADDR = 3574256784



[2007-12-27 16:24:54] yardgnomeray at gmail dot com

Description:

Using integer = 2147483647 for a %u or %d will return 2147483647

Reproduce code:
---
$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
$address = sprintf(IP ADDR = %u, $ipaddr);
echo $address;

Expected result:

IP ADDR = 3574256784

Actual result:
--
IP ADDR = 2147483647





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


#43690 [Opn-Bgs]: sprintf returning unexpected number

2007-12-29 Thread derick
 ID:   43690
 Updated by:   [EMAIL PROTECTED]
 Reported By:  yardgnomeray at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Strings related
 Operating System: Windows XP SP2
 PHP Version:  5.2.5
 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

Nothing is wrong here:

$ip = 213.10.212.144;
var_dump(ip2long( $ip ) );

returns: int(-720710512)

$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
var_dump( $ipaddr );

returns: string(10) 3574256784

Using a string that does not fit in the integer range as a number (with
%d or %u) does not work, as the string itself is first converted to an
integer - which won't work as it doesn't fit. You shouldn't simply use
%u for the returned variable from sprintf() - as it's not a n integer,
but a string (so use %s).



Previous Comments:


[2007-12-29 12:15:50] [EMAIL PROTECTED]

I'm using PHP 5.3.0-dev (cli) (built: Dec 25 2007 10:07:55), and the
convertion was necessary.



[2007-12-29 10:22:44] [EMAIL PROTECTED]

@felipe... you're wrong here - this works just fine without having to
cast to float:

[EMAIL PROTECTED]:~$ php-5.2.5RC2 

?php
$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
$address = sprintf(IP ADDR = %u, $ipaddr);
echo $address;
?

IP ADDR = 3574256784d



[2007-12-28 14:46:42] [EMAIL PROTECTED]

Ops, ignore the part ip2long() returns a string.



[2007-12-28 14:45:19] [EMAIL PROTECTED]

ip2long() returns a string. Converting this value to float for obtain
large precision, you will have the expected result.

$ip = 213.10.212.144;
$ipaddr = sprintf(%u, ip2long($ip));
$address = sprintf(IP ADDR = %u, (float) $ipaddr);

var_dump(PHP_INT_MAX, ip2long($ip), $ipaddr, $address);

--
int(2147483647)
int(-720710512)
string(10) 3574256784
string(20) IP ADDR = 3574256784



[2007-12-27 16:24:54] yardgnomeray at gmail dot com

Description:

Using integer = 2147483647 for a %u or %d will return 2147483647

Reproduce code:
---
$ip = 213.10.212.144;
$ipaddr = sprintf(%u,ip2long($ip));
$address = sprintf(IP ADDR = %u, $ipaddr);
echo $address;

Expected result:

IP ADDR = 3574256784

Actual result:
--
IP ADDR = 2147483647





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


#43703 [Opn-Asn]: Signature compatibility check broken for namespaces

2007-12-29 Thread dmitry
 ID:   43703
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: Irrelevant
 PHP Version:  5.3CVS-2007-12-29 (CVS)
-Assigned To:  
+Assigned To:  dmitry


Previous Comments:


[2007-12-29 10:52:59] [EMAIL PROTECTED]

Description:

When a namespaced class extends an namespaced abstract class, the
signature compatiblity check breaks.

Reproduce code:
---
test.php
?php
require 'joinpoint.php';
require 'pointcut.php';
require 'read.php';

joinpoint.php
?php
namespace GAP;

class JoinPoint
{
}

pointcut.php
?php
namespace GAP;

abstract class Pointcut
{
abstract public function evaluate(JoinPoint $joinPoint);
}

read.php
?php
namespace GAP::Pointcut::Attribute;

use GAP::Joinpoint;
use GAP::Pointcut;

class Read extends Pointcut
{
public function evaluate(JoinPoint $joinPoint)
{
}
}

Expected result:

No syntax error.

Actual result:
--
Fatal error: Declaration of GAP::Pointcut::Attribute::Read::evaluate()
must be compatible with that of GAP::Pointcut::evaluate() in
/home/sb/read.php on line 12





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


#43704 [NEW]: php.ini still wants to be in sys dir

2007-12-29 Thread scratch65535 at att dot net
From: scratch65535 at att dot net
Operating system: w2ksp4
PHP version:  5.2.5
PHP Bug Type: *Configuration Issues
Bug description:  php.ini still wants to be in sys dir

Description:

The php install dir is in the path, but php won't read its ini file from
there.  When i put the ini back in the sysdir (winnt), everything's okay.


-- 
Edit bug report at http://bugs.php.net/?id=43704edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43704r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43704r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43704r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43704r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43704r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43704r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43704r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43704r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43704r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43704r=support
Expected behavior:http://bugs.php.net/fix.php?id=43704r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43704r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43704r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43704r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43704r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43704r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43704r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43704r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43704r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43704r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43704r=mysqlcfg


#43705 [NEW]: when interpreting programs with certain faults, php molests apache 2.2.6

2007-12-29 Thread scratch65535 at att dot net
From: scratch65535 at att dot net
Operating system: w2ksp4
PHP version:  5.2.5
PHP Bug Type: Reproducible crash
Bug description:  when interpreting programs with certain faults, php molests 
apache 2.2.6

Description:

In a php 5.2.5, apache 2.2.6, mysql 5.0.45 setup under w2ksp4, a slightly
sloppy program that v5 doesn't like but that ran fine under v4 -mostly
unacceptable mysql default declarations during table creates- causes php to
molest apache.  My guess would be a loose pointer somewhere.

The symptoms (and these are reproduceable only in the sense that the
pattern has recurred *dozens* of times over the past 2 weeks) are:

- I start execution of the program being debugged.

- The browser (latest FF) tells me 'waiting for localhost', but sysmon
shows no cpu activity by anything but the twiddle process and the monitor
itself.

- I send apache a kill via the services applet, watch the progress bar get
halfway across and then drag its feet until finally the system complains
that apache refuses to shut down.

- a minute or three later, the system BSODs me for an instant, saying
something about 'locked' (it comes and goes too fast for me to read), and
reboots.  The syslog is uninformative.


-- 
Edit bug report at http://bugs.php.net/?id=43705edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43705r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43705r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43705r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43705r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43705r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43705r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43705r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43705r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43705r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43705r=support
Expected behavior:http://bugs.php.net/fix.php?id=43705r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43705r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43705r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43705r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43705r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43705r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43705r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43705r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43705r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43705r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43705r=mysqlcfg


#43706 [NEW]: MSI installer should set the registry value for IniFilePath on IIS ISAPI instal

2007-12-29 Thread zippy1981 at gmail dot com
From: zippy1981 at gmail dot com
Operating system: Windows XP
PHP version:  5.2.5
PHP Bug Type: Feature/Change Request
Bug description:  MSI installer should set the registry value for IniFilePath 
on IIS ISAPI instal

Description:

When installing on windows with the MSI, and selecting IIS ISAPI as the
web server config the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath should be set to the install
directory.


-- 
Edit bug report at http://bugs.php.net/?id=43706edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43706r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43706r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43706r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43706r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43706r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43706r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43706r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43706r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43706r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43706r=support
Expected behavior:http://bugs.php.net/fix.php?id=43706r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43706r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43706r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43706r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43706r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43706r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43706r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43706r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43706r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43706r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43706r=mysqlcfg


#43707 [NEW]: PDOStatement-nextRowset() doesn't work

2007-12-29 Thread lunter at interia dot pl
From: lunter at interia dot pl
Operating system: WinXP
PHP version:  5.3CVS-2007-12-29 (CVS)
PHP Bug Type: PDO related
Bug description:  PDOStatement-nextRowset() doesn't work

Description:

PDOStatement-nextRowset() doesn't work


Reproduce code:
---
?
 $h=new PDO('mysql:host=localhost;dbname=root','root','root');

// $q=$h-query('CALL some_proc()');
 $q=$h-query('SELECT 1 AS col;SELECT 2 AS col;');

 $r=$q-fetchAll(PDO::FETCH_ASSOC);
 print_r($r);

 $q-nextRowset();
 $r=$q-fetchAll(PDO::FETCH_ASSOC);
 print_r($r);
?


Expected result:

Array ( [0] = Array ( [col] = 1 ) ) 

Array ( [0] = Array ( [col] = 2 ) ) 


Actual result:
--
Array ( [0] = Array ( [col] = 1 ) ) 

Array ( ) 


-- 
Edit bug report at http://bugs.php.net/?id=43707edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43707r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43707r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43707r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43707r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43707r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43707r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43707r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43707r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43707r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43707r=support
Expected behavior:http://bugs.php.net/fix.php?id=43707r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43707r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43707r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43707r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43707r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43707r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43707r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43707r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43707r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43707r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43707r=mysqlcfg


#43708 [NEW]: mysqli_stmt_affected_rows return values don't match documentation

2007-12-29 Thread mo at modejong dot com
From: mo at modejong dot com
Operating system: WinXP
PHP version:  5.2.5
PHP Bug Type: MySQLi related
Bug description:  mysqli_stmt_affected_rows return values don't match 
documentation

Description:

The mysqli_stmt_affected_rows implementation does not
match the documentation for this function WRT return
values when no rows are matched or when a SQL error
is found. If you run the source code below, it should
output:

1 (a)
2 (b)
mysqli_stmt_affected_rows(): int(1)
1 (b)
2 (b)
mysqli_stmt_affected_rows(): int(2)
1 (c)
2 (c)
mysqli_stmt_affected_rows(): int(0)
mysqli_stmt_affected_rows(): int(-1)

When run in PHP 5.2.4, the final two lines are:

mysqli_stmt_affected_rows(): int(-1)
mysqli_stmt_affected_rows(): NULL

The docs explicitly state that 0 will be returned
when no rows match and -1 will be returned when
an SQL error is found. The PHP impl should match
the documentation.

Reproduce code:
---
?php

$link = mysqli_connect();
mysqli_select_db($link, test);

  $query = DROP TABLE test;
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);

  $query = CREATE TABLE test (id INTEGER, data VARCHAR(255));
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);

  $query = DELETE FROM test WHERE id=1;
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);

  $query = DELETE FROM test WHERE id=2;
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);

  $query = INSERT INTO test VALUES (2, 'b');
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);

  $query = INSERT INTO test VALUES (1, 'a');
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);



// Util to query and print the rows in the test table

function query() {
  global $link;

  $query = SELECT * FROM test;
  $stmt = mysqli_prepare($link, $query);
  mysqli_stmt_execute($stmt);

  mysqli_stmt_bind_result($stmt, $id, $data);
  while (mysqli_stmt_fetch($stmt)) {
echo $id ($data)\n;
  }

  return $stmt;
}

// Query the data

query();

// Update data in one row

$query = UPDATE test SET data='b' WHERE id=1;
$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);

echo mysqli_stmt_affected_rows(): ;
var_dump(mysqli_stmt_affected_rows($stmt));

// Query the data

query();

// Update data in two rows

$query = UPDATE test SET data='c' WHERE data='b';
$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);

echo mysqli_stmt_affected_rows(): ;
var_dump(mysqli_stmt_affected_rows($stmt));

// Query the data

$stmt = query();

// Invoking mysqli_stmt_affected_rows after a
// SELECT statement should return zero affected rows.

echo mysqli_stmt_affected_rows(): ;
var_dump(mysqli_stmt_affected_rows($stmt));

// Invoking mysqli_stmt_affected_rows after a
// SQL error should return -1.

error_reporting(0);
$query = SELECT * from table_that_does_not_exist;
$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);

echo mysqli_stmt_affected_rows(): ;
var_dump(mysqli_stmt_affected_rows($stmt));

mysqli_close($link);
?

Expected result:

See description

Actual result:
--
See description

-- 
Edit bug report at http://bugs.php.net/?id=43708edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43708r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43708r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43708r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43708r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43708r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43708r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43708r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43708r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43708r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43708r=support
Expected behavior:http://bugs.php.net/fix.php?id=43708r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43708r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43708r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43708r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43708r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43708r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43708r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43708r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43708r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43708r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43708r=mysqlcfg


#43497 [Opn]: OCI8 XML/getClobVal leaks UGA memory

2007-12-29 Thread ghosh at q-one dot com
 ID:   43497
 User updated by:  ghosh at q-one dot com
 Reported By:  ghosh at q-one dot com
 Status:   Open
 Bug Type: OCI8 related
 Operating System: Linux 2.6.22-14-server
 PHP Version:  5.2.5
 New Comment:

Really great! Thanks a lot!! This patch works. What I don't understand:
I thought OCI_RETURN_LOBS is just a short-cut for those who don't want
to write:

$s=$result[0]-load();
$result[0]-free();
$result[0]=$s;

If you use OCI_RETURN_LOBS you dont want to care about lobs but get the
result as a string and forget about lobs altogether. So IMHO this should
work as well. My specific problem is solved though.


Previous Comments:


[2007-12-27 21:44:07] [EMAIL PROTECTED]

This is really an issue with temporary LOBS since getClobVal()
returns a temporary LOB.

There are two parts to the fix: changing the script and patching
the OCI8 extension.  Also don't forget to apply the patch for
http://bugs.php.net/bug.php?id=42496

Please test this suggestion and report any issues.

Thanks to Krishna  Shankar for the solution.

1. Change the test to get the results as LOBs, not as
strings. This allows the script to free temporary LOBs.

In the supplied testcase change:

$query = select extract(xml, '/').getclobval() from ugatest;
$stmt = oci_parse($conn, $query);
if (oci_execute($stmt))
while ($result = oci_fetch_array($stmt,
OCI_NUM+OCI_RETURN_LOBS))
;

to:

$query = select extract(xml, '/').getclobval() from ugatest;
$stmt = oci_parse($conn, $query);
if (oci_execute($stmt))
while ($result = oci_fetch_array($stmt, OCI_NUM)) {
// echo $result[0]-load(), \n; // do something with the
XML
$result[0]-free();  // free the temporary LOB
}

The connection must be open when LOB-free() is called, as the
underlying OCILobFreeTemporary() call does a roundtrip to the
database.


2.  Patch oci8_lob.c.  The change copies some LOB freeing code
from php_oci_lob_close() into php_oci_lob_free():

--- oci8_lob.c.orig2007-07-31 12:21:08.0 -0700
+++ oci8_lob.c2007-12-27 12:33:19.0 -0800
@@ -647,6 +647,9 @@
  Close LOB descriptor and free associated resources */
 void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
 {
+#ifdef HAVE_OCI8_TEMP_LOB
+int is_temporary;
+#endif
 
 if (!descriptor || !descriptor-connection) {
 return;
@@ -662,6 +665,40 @@
 php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC);
 }
 
+#ifdef HAVE_OCI8_TEMP_LOB
+if (descriptor-type == OCI_DTYPE_LOB) {
+PHP_OCI_CALL_RETURN(descriptor-connection-errcode,
+OCILobIsTemporary,
+(
+descriptor-connection-env,
+descriptor-connection-err,
+descriptor-descriptor,
+is_temporary
+ )
+);
+if (descriptor-connection-errcode != OCI_SUCCESS) {
+php_oci_error(descriptor-connection-err,
descriptor-connection-errcode TSRMLS_CC);
+PHP_OCI_HANDLE_ERROR(descriptor-connection,
descriptor-connection-errcode);
+return 1;
+}
+if (is_temporary) {
+PHP_OCI_CALL_RETURN(descriptor-connection-errcode,
+OCILobFreeTemporary,
+(
+descriptor-connection-svc,
+descriptor-connection-err,
+descriptor-descriptor
+ )
+);
+if (descriptor-connection-errcode != OCI_SUCCESS) {
+php_oci_error(descriptor-connection-err,
descriptor-connection-errcode TSRMLS_CC);
+PHP_OCI_HANDLE_ERROR(descriptor-connection,
descriptor-connection-errcode);
+return 1;
+}
+}
+}
+#endif
+
 PHP_OCI_CALL(OCIDescriptorFree, (descriptor-descriptor,
descriptor-type));
 
 zend_list_delete(descriptor-connection-rsrc_id);




[2007-12-20 18:04:32] ghosh at q-one dot com

Would pay someone who resolves this bug. Feel free to contact me if you
are interested.



[2007-12-05 23:18:05] [EMAIL PROTECTED]

Confirmed.



[2007-12-04 13:09:49] ghosh at q-one dot com

Description:

There is a memory leaking when using the OCI8 interface and querying 
XML columns. Demo code available via the url below. This creates a 
table with an XML column and queries this column. UGA memory is 
leaking. This does not happen when doing the same directly via 
SQLPlus.

Reproduce code:
---
http://oberon.q-one-hosting.com/6648051.txt

Expected result:

No UGA memory leaking

Actual result:
--
UGA 

#43711 [NEW]: Can't load php_mssql.dll

2007-12-29 Thread vlad275 at ya dot ru
From: vlad275 at ya dot ru
Operating system: Windows 2003
PHP version:  5.3CVS-2007-12-30 (snap)
PHP Bug Type: MSSQL related
Bug description:  Can't load php_mssql.dll

Description:

Windows2003+IIS+PHP5.3.0+MS SQL Server 2005 
Can't load php_mssql.dll


1. Installed under IIS php-5.2.5-win32-installer.msi as ISAPI for .php
2. Uncommented at php.ini  extension=msql.dll
3. Added at php.ini  extension=php_mssql.dll
4. Copied all extentions into C:\WINDOWS\system32\
5. Copied ntwdblib.dll version 8.x into c:\php and c:\windows\system32. 
6. Reooted

Fatal error: Call to undefined function mssql_connect()

What do I have to do?!!!

Reproduce code:
---
if (function_exists('mssql_connect')) echo Okay, fn is there; else echo
Not found\n;
echo phpinfo();

print_r (get_loaded_extensions());


$mssql_server='195.42.181.173';
$mssql_user='';
$mssql_pass='';
mssql_connect($mssql_server,$mssql_user,$mssql_pass);

Expected result:

'Okay, fn is there'

I wanna use 'mssql_connect'!!! I cannot! Help me!!!

Actual result:
--
Not found

1Array ( [0] = bcmath [1] = calendar [2] = com_dotnet [3] = ctype [4]
= session [5] = ereg [6] = filter [7] = ftp [8] = hash [9] = iconv
[10] = json [11] = mysqlnd [12] = odbc [13] = pcre [14] = Reflection
[15] = date [16] = libxml [17] = standard [18] = tokenizer [19] = zlib
[20] = SimpleXML [21] = dom [22] = SPL [23] = wddx [24] = xml [25] =
xmlreader [26] = xmlwriter [27] = ISAPI )

Fatal error: Call to undefined function mssql_connect() in
C:\Inetpub\wwwroot\administrator\vt_example.php on line 52

-- 
Edit bug report at http://bugs.php.net/?id=43711edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43711r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43711r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43711r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43711r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43711r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43711r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43711r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43711r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43711r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43711r=support
Expected behavior:http://bugs.php.net/fix.php?id=43711r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43711r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43711r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43711r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43711r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43711r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43711r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43711r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43711r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43711r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43711r=mysqlcfg


#43711 [Opn-Bgs]: Can't load php_mssql.dll

2007-12-29 Thread fmk
 ID:   43711
 Updated by:   [EMAIL PROTECTED]
 Reported By:  vlad275 at ya dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: MSSQL related
 Operating System: Windows 2003
 PHP Version:  5.3CVS-2007-12-30 (snap)
 New Comment:

Step 2 indicates your are loading msql instead of mssql. Those are two
different extensions.

If that's just a typo in your submission you are most likely missing
the ntwdblib.dll in \windows\system32. This file is required for the
mssql extension to load. You can copy this file from the server or you
can install the client tools on your PHP server box.


Previous Comments:


[2007-12-30 04:13:03] vlad275 at ya dot ru

Description:

Windows2003+IIS+PHP5.3.0+MS SQL Server 2005 
Can't load php_mssql.dll


1. Installed under IIS php-5.2.5-win32-installer.msi as ISAPI for .php
2. Uncommented at php.ini  extension=msql.dll
3. Added at php.ini  extension=php_mssql.dll
4. Copied all extentions into C:\WINDOWS\system32\
5. Copied ntwdblib.dll version 8.x into c:\php and c:\windows\system32.

6. Reooted

Fatal error: Call to undefined function mssql_connect()

What do I have to do?!!!

Reproduce code:
---
if (function_exists('mssql_connect')) echo Okay, fn is there; else
echo Not found\n;
echo phpinfo();

print_r (get_loaded_extensions());


$mssql_server='195.42.181.173';
$mssql_user='';
$mssql_pass='';
mssql_connect($mssql_server,$mssql_user,$mssql_pass);

Expected result:

'Okay, fn is there'

I wanna use 'mssql_connect'!!! I cannot! Help me!!!

Actual result:
--
Not found

1Array ( [0] = bcmath [1] = calendar [2] = com_dotnet [3] = ctype
[4] = session [5] = ereg [6] = filter [7] = ftp [8] = hash [9] =
iconv [10] = json [11] = mysqlnd [12] = odbc [13] = pcre [14] =
Reflection [15] = date [16] = libxml [17] = standard [18] =
tokenizer [19] = zlib [20] = SimpleXML [21] = dom [22] = SPL [23] =
wddx [24] = xml [25] = xmlreader [26] = xmlwriter [27] = ISAPI )

Fatal error: Call to undefined function mssql_connect() in
C:\Inetpub\wwwroot\administrator\vt_example.php on line 52





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