#47060 [NEW]: gc_maxlifetime not runned

2009-01-09 Thread bbogdan at easylinks dot ro
From: bbogdan at easylinks dot ro
Operating system: Windows XP SP 3
PHP version:  5.2.8
PHP Bug Type: Session related
Bug description:  gc_maxlifetime not runned

Description:

A session is not deleted after cookie_lifetime expires and gc run if
expiration date is modified in user stored cookie.

Reproduce code:
---
ini_set('session.cookie_lifetime', 10);
ini_set('session.gc_maxlifetime', 5);
ini_set('session.gc_divisor', 1);

session_start();
if ( isset($_SESSION['a']) ) {
echo 'is set';
} else {
echo 'is not set';
$_SESSION['a'] = true;
}

Expected result:

If i manualy modify the cookie to have a longer lifetime (2-3 mins) and
rerun the script after 20 seconds i expect the session to be deleted by gc.
(works as expected on linux)

Actual result:
--
The cookie persists after 10 seconds if you modify the stored cookie
lifetime.

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



#47051 [Opn]: pg_fetch_object does not convert to literal PHP booleans

2009-01-09 Thread germ dot van dot eck at gmail dot com
 ID:   47051
 User updated by:  germ dot van dot eck at gmail dot com
 Reported By:  germ dot van dot eck at gmail dot com
 Status:   Open
 Bug Type: PostgreSQL related
 Operating System: Linux, Ubuntu 8.04
 PHP Version:  5.2.8
 New Comment:

I did not complete my sentence...
"This causes that postgresql."
should be
"This causes that postgresql's booleans are not very usable in PHP".


Previous Comments:


[2009-01-09 13:24:51] germ dot van dot eck at gmail dot com

Description:

Postgresql booleans are internally stored as either 'f' or 't' (False
or True).
On retrieval using pg_fetch_object, they are simply retrieved as PHP
strings, rather than either 0 or 1, or even better, false or true.
This causes that postgresql.
I am not sure, but I think in the data returned by the server, there is
metadata explaining the field types and so they could be automatically
converted to PHP bools.
This is from a bugreport and related forum topic that was made for the
CodeIgniter framework.
Bugreport (slighly unrelated CI bug, but this issue was discussed in
the comments):
http://codeigniter.com/bug_tracker/bug/6303/
Forum topic:
http://codeigniter.com/forums/viewthread/101001/


Reproduce code:
---
test."\n";
pg_query('DROP TABLE test');
?>


Expected result:

1

Actual result:
--
t





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



#47059 [Com]: Apache crashes php5ts.dll

2009-01-09 Thread brian at alternate-zone dot com
 ID:   47059
 Comment by:   brian at alternate-zone dot com
 Reported By:  brian at alternate-zone dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

I'm using PHP5.2.8 Win32 zip package
and the mysql dll is: php_mysql.dll


Previous Comments:


[2009-01-10 00:38:52] paj...@php.net

Which PHP binaries do you use and which mysql DLL?



[2009-01-10 00:36:28] brian at alternate-zone dot com

Description:

when I try to make a connection to the database Mysql the Apache HTTP
server crashes.

szAppName: httpd.exe szAppVer: 2.2.11.0 szModName: php5ts.dll
szModVerL 5.2.8.8 offset: 9fe6

Reproduce code:
---
';
echo 'Name: ' . $field['name'] . '';
}

?>

Expected result:

ID: 1
Name: John

Actual result:
--
Apache HTTP Server has encountered a problem and needs to close





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



#47055 [Asn->Csd]: Compilation errors in ext/sqlite3/libsqlite

2009-01-09 Thread scottmac
 ID:   47055
 Updated by:   scott...@php.net
 Reported By:  giovanni at giacobbi dot net
-Status:   Assigned
+Status:   Closed
 Bug Type: Compile Failure
 Operating System: Linux Debian 4.0
 PHP Version:  5.3CVS-2009-01-09 (snap)
 Assigned To:  scottmac
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-01-09 15:42:01] giovanni at giacobbi dot net

./configure \
  --bindir=/usr/local/lib/php/bin \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --disable-cgi \
  --with-config-file-path=/usr/local/lib/php5 \
  --with-openssl \
  --with-zlib \
  --enable-bcmath \
  --with-bz2=shared \
  --enable-calendar \
  --with-curl=shared \
  --enable-dba=shared \
  --with-db4=shared \
  --enable-ftp \
  --with-gd \
  --with-freetype-dir --enable-gd-native-ttf \
  --with-gettext=shared \
  --without-mhash \
  --with-iconv=shared \
  --enable-intl=shared \
  --enable-mbstring \
  --with-mysql --with-mysql-sock=/var/run/mysqld/mysqld.sock \
  --enable-pcntl \
  --enable-dom \
  --with-xmlrpc \
  --enable-soap \
  --enable-sockets



[2009-01-09 15:36:42] scott...@php.net

What was the configure line you were using?



[2009-01-09 15:28:47] giovanni at giacobbi dot net

Description:

During the final linking of sapi/cli/php I get the following errors.
Adding "-licui18n" solves the problem.

ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuNext':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100648:
undefined reference to `ubrk_current_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100649:
undefined reference to `ubrk_next_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100677:
undefined reference to `u_strToUTF8_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100656:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuClose':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100622:
undefined reference to `ubrk_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeCompare':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100043:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100091:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100092:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100093:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100064:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100075:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100082:
undefined reference to `utf8_countTrailBytes_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeFunc':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100143:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuOpen':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100590:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100599:
undefined reference to `utf8_nextCharSafeBody_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100605:
undefined reference to `ubrk_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100612:
undefined reference to `ubrk_first_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100587:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuFunctionError':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100169:
undefined reference to `u_errorName_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLoadCollation':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100388:
undefined reference to `ucol_open_3_6'
/home/j

#47059 [Opn->Fbk]: Apache crashes php5ts.dll

2009-01-09 Thread pajoye
 ID:   47059
 Updated by:   paj...@php.net
 Reported By:  brian at alternate-zone dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

Which PHP binaries do you use and which mysql DLL?


Previous Comments:


[2009-01-10 00:36:28] brian at alternate-zone dot com

Description:

when I try to make a connection to the database Mysql the Apache HTTP
server crashes.

szAppName: httpd.exe szAppVer: 2.2.11.0 szModName: php5ts.dll
szModVerL 5.2.8.8 offset: 9fe6

Reproduce code:
---
';
echo 'Name: ' . $field['name'] . '';
}

?>

Expected result:

ID: 1
Name: John

Actual result:
--
Apache HTTP Server has encountered a problem and needs to close





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



#47059 [NEW]: Apache crashes php5ts.dll

2009-01-09 Thread brian at alternate-zone dot com
From: brian at alternate-zone dot com
Operating system: Windows XP
PHP version:  5.2.8
PHP Bug Type: Reproducible crash
Bug description:  Apache crashes php5ts.dll

Description:

when I try to make a connection to the database Mysql the Apache HTTP
server crashes.

szAppName: httpd.exe szAppVer: 2.2.11.0 szModName: php5ts.dll
szModVerL 5.2.8.8 offset: 9fe6

Reproduce code:
---
';
echo 'Name: ' . $field['name'] . '';
}

?>

Expected result:

ID: 1
Name: John

Actual result:
--
Apache HTTP Server has encountered a problem and needs to close

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



#47057 [Opn->Asn]: Inconsitent namespace resolving when using dynamic class instanciation

2009-01-09 Thread felipe
 ID:   47057
 Updated by:   fel...@php.net
 Reported By:  tobias dot john at fondsnet dot de
-Status:   Open
+Status:   Assigned
-Bug Type: Class/Object related
+Bug Type: Scripting Engine problem
 Operating System: Mac OS X 10.5
 PHP Version:  5.3CVS-2009-01-09 (CVS)
-Assigned To:  
+Assigned To:  dmitry


Previous Comments:


[2009-01-09 17:39:14] tobias dot john at fondsnet dot de

Description:

When using a variable to instantiate a class, the behavior in namespace
resolving is inconsistent to the behavior when using a static class
name.

Reproduce code:
---
namespace foo\bar;

class Baz {
public $value;

public function __construct($v) {
$this->value = $v;
}

public function echoValue() {
echo 'Value: ' . $this->value, PHP_EOL;
}
}

$classname1 = '\foo\bar\Baz';
$classname2 = 'foo\bar\Baz';

$a = new $classname1('A');
$a->echoValue();
$b = new $classname2('B');
$b->echoValue();
$c = new \foo\bar\Baz('C');
$c->echoValue();
$d = new foo\bar\Baz('D');
$d->echoValue();

Expected result:

Value: A

Fatal error: Class 'foo\bar\foo\bar\Baz' not found in
/Users/tj/Documents/workspace/yeti/lib/yeti/NamespaceTest.php on line
20


Actual result:
--
Value: A
Value: B
Value: C

Fatal error: Class 'foo\bar\foo\bar\Baz' not found in
/Users/tj/Documents/workspace/yeti/lib/yeti/NamespaceTest.php on line
24






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



#38111 [Com]: PHP crashes IIS worker process and application pool

2009-01-09 Thread damon at clarkweb dot com
 ID:   38111
 Comment by:   damon at clarkweb dot com
 Reported By:  svendavidh at hotmail dot com
 Status:   No Feedback
 Bug Type: IIS related
 Operating System: Windows Server 2003 Std. Ed. R2
 PHP Version:  5.2.8
 Assigned To:  pajoye
 New Comment:

Same problems with PHP 5.2.8 on Vista SP1.  Following SIKLE's steps 
reproduces the bug every time.  This has been open far too long for 
an easily reproducable bug.  Please address!


Previous Comments:


[2009-01-04 10:46:52] sikle at stx dot net 

Oh here's a 100% repro:

1. Load a php program. For example, I just go to
http://localhost/phpmyadmin, I then logon to my database, and then I
just close the browser.

2. Now go into IIS, on the left side double click on the computer name
and then you'll see "Application Pools", now click on it.

3. Now click on "DefaultAppPool" and then on the right side of the
screen you'll see "Recycle..." click on it.

Now after you clicked on "Recycle...", within about 4 seconds you'll
see the crash: "IIS Worker Process has stopped working".

Whoever fixes this bug will be my personal hero.



[2009-01-04 10:31:17] sikle at stx dot net

Dear programmers,

Please fix this bug :~( (with a cherry on top?) I'm on PHP 5.2.8 and it
happens all the time (on average 5-6 times a day) and it's very
annoying. Like the others have mentioned I assume this is a memory
bug that is triggered when IIS recycles its application pool.



[2008-12-27 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2008-12-22 02:41:45] todd at lanlocked dot net

Just following up:

I believe it is 1740 seconds, not minutes
I am running IIS 7 on Server 2008 Std 64 bit
PHP is running outside of the default app pool, although in trying to
resolve the issue I set it up with the default app pool and it did the
same thing

Could someone let me know how to backtrace the correct process (I
assume I have to backtrace an IIS worker process) and we can get it
sorted?



[2008-12-22 02:30:15] todd at lanlocked dot net

RE paj...@php.net

There is no php.exe process to generate a backtrace from. It is loaded
via ISAPI. I am having the same problem with PHP 5.2.8 on a clean
install of IIS7 on Server 2008. It is done via ISAPI.

Furthermore there is no test script to reproduce this - it appears to
happen when IIS shuts down the worker process after 1740 minutes due to
inactivity.

Kind Regards,
Todd



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/38111

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



#47058 [Opn->Bgs]: ReflectionFunction::getParameters() retuns null

2009-01-09 Thread felipe
 ID:   47058
 Updated by:   fel...@php.net
 Reported By:  z...@php.net
-Status:   Open
+Status:   Bogus
 Bug Type: Reflection related
 Operating System: Linux and Windows
 PHP Version:  5.2.8
 New Comment:

Hi Zoe, this is expected. As of 5.3 we have added all missing arginfo
for all ext/*, then we have:

ZEND_BEGIN_ARG_INFO_EX(arginfo_gzopen, 0, 0, 2)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, mode)
ZEND_ARG_INFO(0, use_include_path)
ZEND_END_ARG_INFO()

That helps reflection to know about the param name, number of
parameters, if the param(s) is/are by ref.

Prior 5.3, few extensions did make use of the arginfo (the
ZEND_BEGIN_ARG_INFO_EX stuff).


Previous Comments:


[2009-01-09 20:48:10] z...@php.net

Description:

ReflectionFunction::getParameters() returns an empty array for some
(not all) functions which have parameters.

This feature works correctly in PHP53, as far as I can tell the code to
make it work was added on 11/08/2008 by cseiler, there is no bug
reference in the CVS comment so I don't think this is a duplicate,
apologies if there is and I have failed to find it.

Reproduce code:
---
http://pastebin.ca/1304533

Note: PHP needs to be built with zlib to run this.

Expected result:

As shown in the test case above

Actual result:
--
array(0) {
}





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



#47058 [NEW]: ReflectionFunction::getParameters() retuns null

2009-01-09 Thread z...@php.net
From: z...@php.net
Operating system: Linux and Windows
PHP version:  5.2.8
PHP Bug Type: Reflection related
Bug description:  ReflectionFunction::getParameters() retuns null

Description:

ReflectionFunction::getParameters() returns an empty array for some (not
all) functions which have parameters.

This feature works correctly in PHP53, as far as I can tell the code to
make it work was added on 11/08/2008 by cseiler, there is no bug reference
in the CVS comment so I don't think this is a duplicate, apologies if there
is and I have failed to find it.

Reproduce code:
---
http://pastebin.ca/1304533

Note: PHP needs to be built with zlib to run this.

Expected result:

As shown in the test case above

Actual result:
--
array(0) {
}

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



#46850 [Asn]: compile time depends on runtime constants ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION

2009-01-09 Thread stas
 ID:   46850
 Updated by:   s...@php.net
 Reported By:  moo dot tinys at gmail dot com
 Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.3CVS-2008-12-12 (CVS)
 Assigned To:  dmitry
 New Comment:

I'm not sure why you need to clean up EG(zend_constants). Together with
runtime constants it also contains such constants as null, which has
special "privilege" of being resolved at compile-time, since they are
always the same and have special meaning. 


Previous Comments:


[2008-12-12 14:57:17] moo dot tinys at gmail dot com

Description:

let's focus our eyes on
  zend_compile.c function zend_do_receive_arg
void zend_do_receive_arg(zend_uchar op, const znode *var, const znode
*offset, const znode *initialization, znode *class_type, const znode
*varname, zend_uchar pass_by_reference TSRMLS_DC)
{
...
   if (op == ZEND_RECV_INIT) {
   if (Z_TYPE(initialization->u.constant) == IS_NULL ||
(Z_TYPE(initialization->u.constant) == IS_CONSTANT &&
!strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
   cur_arg_info->allow_null = 1;
   } else {
   zend_error(E_COMPILE_ERROR, "Default value for
parameters with a class type hint can only be NULL");
   }
   }
==
(the following gdb input/output is still using macro for your reading,
expand the macro if you want to execute)

test case 1
precondition: CG(compiler_options) |=
ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION; before zend_compile_file
break at function zend_do_receive_arg and
(gdb) print Z_TYPE(initialization->u.constant) == IS_NULL
1 (true)
which means php still subst "null" to "IS_NULL"

test case 2
precondtion: let's assume ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION is
working for zend_do_receive_arg, simply empty hash table:
EG(zend_constants) = &an_empty_hash_table; before zend_compile_file
break at function zend_do_receive_arg and
(gdb) print Z_TYPE(initialization->u.constant) == IS_NULL
0 (false)
(gdb) print Z_TYPE(initialization->u.constant) == IS_CONSTANT
0 (false)

so what is that?
(gdb) print Z_TYPE(initialization->u.constant)
24
(gdb) print (Z_TYPE(initialization->u.constant) &
IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
1 (true)
 ok, we get the first bug
(gdb) p !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))
0 (false)
why?
(gdb) p Z_STRVAL(initialization->u.constant)
"My\\NS\\null"
this is the reason. looks likestrcasecmp is not enough here at compile
time. or you could just handle abc(array $a = null) as a special case?

Reproduce code:
---
test.php


i don't think it easy to make a reproduce code, because
in case 1: ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION is disabled until you
change it in extension or patch php for testing
and in case 2: even if you enable
ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION, php is still free to access
EG(zend_constants), EG(zend_constants) has to be empty to see the bug.
see "actual result"

there's a simple patch to reproduce it. (not fix)
Index: zend_language_scanner.l
===
RCS file: /repository/ZendEngine2/zend_language_scanner.l,v
retrieving revision 1.131.2.11.2.13.2.32
diff -u -r1.131.2.11.2.13.2.32 zend_language_scanner.l
--- zend_language_scanner.l 4 Nov 2008 15:58:51 -  
1.131.2.11.2.13.2.32
+++ zend_language_scanner.l 12 Dec 2008 14:54:47 -
@@ -311,6 +311,8 @@

 ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle,
int type TSRMLS_DC)
 {
+   HashTable empty_hash, *old_hash;
+
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *)
emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);
@@ -320,6 +322,12 @@
znode retval_znode;
zend_bool original_in_compilation = CG(in_compilation);

+   CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION;
+   zend_hash_init(&empty_hash, 1, NULL, NULL, 0);
+   old_hash = EG(zend_constants);
+   EG(zend_constants) = &empty_hash;
+   fprintf(stderr, "asdfasdf\n\n");
+
retval_znode.op_type = IS_CONST;
retval_znode.u.constant.type = IS_LONG;
retval_znode.u.constant.value.lval = 1;
@@ -364,6 +372,10 @@
if (compilation_successful) {
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
}
+
+   zend_hash_destroy(&empty_hash);
+   EG(zend_constants) = old_hash;
+
return retval;
 }



Expected result:

in case 1: when ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION is enabled,
"null" (code) should not be resolved to "null" (value, which is IS_NULL)
at compile time, and should be resolve at runtime.

in case 2: at compile time, php should behavoir the same regardless to
what EG(zend_constants). when EG(zend_constants) is empty, it should not
raise ""Default value for
parameters

#46974 [Asn->Opn]: Closure and Namespaces bug! FATAL ERROR

2009-01-09 Thread stas
 ID:   46974
 Updated by:   s...@php.net
 Reported By:  info at netmosfera dot it
-Status:   Assigned
+Status:   Open
-Bug Type: Scripting Engine problem
+Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.3.0alpha3
 Assigned To:  stas
 New Comment:

I think you can easily implement it in user-space by using either one
autoloader checking class name or using multiple autoloaders and
http://www.php.net/manual/en/function.spl-autoload-register.php

I'm not sure it is practical to do it in the engine as it would require
a lot of search around for autoloaders by the engine. I think it's
better done in user-space.


Previous Comments:


[2009-01-02 01:11:21] info at netmosfera dot it

hi, thanks for accepting this bug

i have one request, is possible to make autoloads for namespaces?
is this back compatible?

namespace a
{
  function __autoload(){echo "a";}
  new Pippo();
}


namespace b
{
  function __autoload(){echo "b";}
  new Pippo();
}

thank you



[2008-12-30 17:19:24] info at netmosfera dot it

ok, with __autoload in global namespace works

if you remove the closure but works too

where's the problem?



[2008-12-30 16:50:06] info at netmosfera dot it

uhm... autoload is not called!

another suggest:
Closure is a special class\type

so it must be global
in a namespace i have to use

public function method(\Closure $x){}

instead of

public function method(Closure $x){}

is it correct? Closure is a special type and final too



[2008-12-30 16:40:22] info at netmosfera dot it

Description:

hi,
i noticed there is a bug that causes a FATAL ERROR
please read the code
thank you for your time

Reproduce code:
---
file index.php:



file Clsure-Testing.php:


Actual result:
--
Fatal error: Class 'Clsure\Testing' not found in on line 12





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



#42718 [Com]: FILTER_UNSAFE_RAW not applied when configured as default filter, even with flags

2009-01-09 Thread tarmuli at hotmail dot com
 ID:   42718
 Comment by:   tarmuli at hotmail dot com
 Reported By:  arnaud dot lb at gmail dot com
 Status:   Assigned
 Bug Type: Filter related
 Operating System: *
 PHP Version:  5CVS-2008-11-01
 Assigned To:  pajoye
 New Comment:

Thaks!baybay


Previous Comments:


[2008-12-06 19:20:34] paj...@php.net

Yes, revert was the best option for now.

I will dig into it on Monday and re read the discussions about that
(there was some discussions about this whole thing when we added filter
to core).




[2008-12-06 19:17:09] lbarn...@php.net

> That's wrong

This is exactly what you said one year ago, just before it was
demonstrated that FILTER_UNSAFE_RAW actually does something (according
to documentation, code, and examples), and the bug has been assigned to
you.

That said, I'm not rejecting the fault on anyone, and the important is
to revert, which is done.




[2008-12-06 18:25:20] paj...@php.net

ooch.

I did not catch in this bug before, but there is a major
misunderstanding in the first comment.

"The unsafe_raw filter does nothing by default, but it 
can "optionally strip or encode special characters", and it is the 
only filter which is able to do that without doing any other 
filtering."

That's wrong. UNSAFE_RAW, the key word here is RAW. It means that the
data is returned unfiltered, without flag, nothing, nada. If this
behavior has been changed then please revert it.

I did not check if it is present in 5.2.7 (it seems to be, as said in
this report or another), that may require a quick fix release (Ilia?).



[2008-12-06 17:52:37] lbarn...@php.net

All my apologizes for this broken fix.

A quick workaround for 5.2.7 users is to add the following in the
php.ini:
filter.default_flags=0

Scott has reverted this and this bug is not present in CVS.



[2008-12-06 17:32:55] magical...@php.net

This is a proposed fix for this bug that will keep old behavior.

Another fix could be simply to test IF_G(default_filter_flags) against
FILTER_FLAG_NO_ENCODE_QUOTES instead of 0.

http://ookoo.org/svn/snip/php_5_2-broken_filter_and_magic_quotes.patch



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/42718

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



#47057 [NEW]: Inconsitent namspace resolving when using dynamic class instanciation.

2009-01-09 Thread tobias dot john at fondsnet dot de
From: tobias dot john at fondsnet dot de
Operating system: Mac OS X 10.5
PHP version:  5.3CVS-2009-01-09 (CVS)
PHP Bug Type: Class/Object related
Bug description:  Inconsitent namspace resolving when using dynamic class 
instanciation.

Description:

When using a variable to instantiate a class, the behavior in namespace
resolving is inconsistent to the behavior when using a static class name.

Reproduce code:
---
namespace foo\bar;

class Baz {
public $value;

public function __construct($v) {
$this->value = $v;
}

public function echoValue() {
echo 'Value: ' . $this->value, PHP_EOL;
}
}

$classname1 = '\foo\bar\Baz';
$classname2 = 'foo\bar\Baz';

$a = new $classname1('A');
$a->echoValue();
$b = new $classname2('B');
$b->echoValue();
$c = new \foo\bar\Baz('C');
$c->echoValue();
$d = new foo\bar\Baz('D');
$d->echoValue();

Expected result:

Value: A

Fatal error: Class 'foo\bar\foo\bar\Baz' not found in
/Users/tj/Documents/workspace/yeti/lib/yeti/NamespaceTest.php on line 20


Actual result:
--
Value: A
Value: B
Value: C

Fatal error: Class 'foo\bar\foo\bar\Baz' not found in
/Users/tj/Documents/workspace/yeti/lib/yeti/NamespaceTest.php on line 24


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



#47056 [NEW]: Suppress "command aborted" messages

2009-01-09 Thread backus at genepi dot med dot utah dot edu
From: backus at genepi dot med dot utah dot edu
Operating system: Red Hat AS 5
PHP version:  5.2.8
PHP Bug Type: Feature/Change Request
Bug description:  Suppress "command aborted" messages

Description:

This is a repeat of bug #11262.  When using sybase_get_last_message I get
command has been aborted instead of the actual problem.



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



#46844 [Opn->Csd]: First line of included files not output if they begin with #

2009-01-09 Thread iliaa
 ID:   46844
 Updated by:   il...@php.net
 Reported By:  phildrisc...@php.net
-Status:   Open
+Status:   Closed
 Bug Type: Scripting Engine problem
 Operating System: Ubuntu Gutsy
 PHP Version:  5.3.0alpha3
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-01-01 20:29:51] nlop...@php.net

reopen, the bug is still alive.
just change test.inc to
#!1
...



[2009-01-01 20:19:46] il...@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.





[2008-12-29 12:52:01] johan...@php.net

That should be fixed for 5.3.



[2008-12-17 02:45:55] j...@php.net

I was kinda hoping it was some CLI/CGI thing only. :)





[2008-12-16 18:41:52] phildrisc...@php.net

Yes Jani - my test setup has PHP compiled as an Apache2 module.



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/46844

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



#40787 [Com]: Error trying to insert into a CLOB column when using multi-byte charset.

2009-01-09 Thread inbox at trevorbramble dot com
 ID:  40787
 Comment by:  inbox at trevorbramble dot com
 Reported By: jarismar at adplabs dot com dot br
 Status:  Assigned
 Bug Type:PDO related
 PHP Version: 5.2.1
 Assigned To: wez
 New Comment:

I am experiencing the same error as charles at crh-systems dot com,
however I'm trying to enter a string into a varchar2(4000) column.

I've gone through a lot in the course of diagnosing this problem so I
can't recall exactly what changed, but originally I was getting this
error:

ORA-01460: unimplemented or unreasonable conversion requested

The resolution has been to define the length for that parameter:

$stmt->bindParam( ':notes', $this->notes, PDO::PARAM_STR, 4000 );

Why this fixes the problem is still a mystery.  None of the inserted
data is lost, so there don't appear to have really been too many bytes
in the string to insert.  I'm not experiencing the same problem with any
of the smaller columns (a string of 4 or more characters will insert
into a column defined varchar2(10), for example).


Previous Comments:


[2008-04-01 03:28:49] charles at crh-systems dot com

I am having the same problem, 
OCIStmtExecute: ORA-01461: can bind a LONG value only for insert into a
LONG column

I can only get 1333 chars to insert into a clob field no matter which
connection charset I use.
4000 / 3 = 1333.333

...any fixes?



[2007-03-12 18:27:14] jarismar at adplabs dot com dot br

Many thanks for the faster reply, I've tested with suggested snapshot
PHP Version: 5.2.2-dev
Build Date : Mar 12 2007 16:05:36

But the problem still occurs.

It seems that PDO get wrong data type for the CLOB column.
I can just insert up to 4000 bytes into the CLOB column, because the
extension thinks its handling a LONG column.



[2007-03-12 18:03:41] tony2...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip





[2007-03-12 17:36:53] jarismar at adplabs dot com dot br

Description:

I'm using pdo_oci and oracle 10g (10.2).

Trying to insert into a CLOB column using multi-byte charset (AL32UTF8)
results on the following error:

ORA-01461: can bind a LONG value only for insert into a LONG column.

The column datatype in not LONG it's a CLOB !

Changing the connection charset to use WE8ISO8859P1 or any other single
byte charset solve the problem (the insert command ends with no error),
but I loose all non ISO characters (my data gets corrupted).

Reproduce code:
---
try {
  $sDSN = "oci:dbname=$sConId;charset=AL32UTF8";
  $oPDO = new PDO($sDSN, $sUserName, $sPassword);
  $oPDO->beginTransaction();
  $oStmt = $oPDO->prepare("insert into test_clob (id, data) values
(:id, EMPTY_CLOB())");
  $iID = 1;
  $oStmt->bindParam(':id', $iID);
  if ($oStmt->execute()) {
$oStmt = $oPDO->prepare("update test_clob set data=:value where
id=1");
$sData = str_repeat('x', 65535);
$oStmt->bindParam(':value', $sData);
if ($oStmt->execute() === false) {
  throw new Exception('Error on update clob');
}
  } else {
throw new Exception('Error on insert EMPTY_CLOB');
  }

  $oStmt = $oPDO->prepare("select data from test_clob where id =
:id");
  $oStmt->bindParam('id', $iID);
  $oStmt->execute();
  $oResult = $oStmt->fetch();
  echo 'Read '.strlen(stream_get_contents($oResult['DATA'])).'
characters ';
  $oPDO->commit();

} catch (Exception $oE) {
  if ($oStmt) {
echo '';print_r($oStmt->errorInfo());echo "\n";
  }
  echo $oE->getMessage()."\n";
}
$oPDO = null;

Expected result:

Read 65535 characters

Actual result:
--
Array
(
[0] => HY000
[1] => 1461
[2] => OCIStmtExecute: ORA-01461: can bind a LONG value only for
insert into a LONG column
 (ext\pdo_oci\oci_statement.c:142)
)


Error on update clob





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



#47055 [Asn]: Compilation errors in ext/sqlite3/libsqlite

2009-01-09 Thread giovanni at giacobbi dot net
 ID:   47055
 User updated by:  giovanni at giacobbi dot net
 Reported By:  giovanni at giacobbi dot net
 Status:   Assigned
 Bug Type: Compile Failure
 Operating System: Linux Debian 4.0
 PHP Version:  5.3CVS-2009-01-09 (snap)
 Assigned To:  scottmac
 New Comment:

./configure \
  --bindir=/usr/local/lib/php/bin \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --disable-cgi \
  --with-config-file-path=/usr/local/lib/php5 \
  --with-openssl \
  --with-zlib \
  --enable-bcmath \
  --with-bz2=shared \
  --enable-calendar \
  --with-curl=shared \
  --enable-dba=shared \
  --with-db4=shared \
  --enable-ftp \
  --with-gd \
  --with-freetype-dir --enable-gd-native-ttf \
  --with-gettext=shared \
  --without-mhash \
  --with-iconv=shared \
  --enable-intl=shared \
  --enable-mbstring \
  --with-mysql --with-mysql-sock=/var/run/mysqld/mysqld.sock \
  --enable-pcntl \
  --enable-dom \
  --with-xmlrpc \
  --enable-soap \
  --enable-sockets


Previous Comments:


[2009-01-09 15:36:42] scott...@php.net

What was the configure line you were using?



[2009-01-09 15:28:47] giovanni at giacobbi dot net

Description:

During the final linking of sapi/cli/php I get the following errors.
Adding "-licui18n" solves the problem.

ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuNext':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100648:
undefined reference to `ubrk_current_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100649:
undefined reference to `ubrk_next_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100677:
undefined reference to `u_strToUTF8_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100656:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuClose':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100622:
undefined reference to `ubrk_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeCompare':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100043:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100091:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100092:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100093:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100064:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100075:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100082:
undefined reference to `utf8_countTrailBytes_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeFunc':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100143:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuOpen':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100590:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100599:
undefined reference to `utf8_nextCharSafeBody_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100605:
undefined reference to `ubrk_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100612:
undefined reference to `ubrk_first_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100587:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuFunctionError':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100169:
undefined reference to `u_errorName_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLoadCollation':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100388:
undefined reference to `ucol_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100399:
undefined reference to `ucol_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCollationColl':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100345:
undefined reference to `ucol_strcoll_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCaseFunc16':
/home/johnny/build/

#47055 [Opn->Asn]: Compilation errors in ext/sqlite3/libsqlite

2009-01-09 Thread scottmac
 ID:   47055
 Updated by:   scott...@php.net
 Reported By:  giovanni at giacobbi dot net
-Status:   Open
+Status:   Assigned
 Bug Type: Compile Failure
 Operating System: Linux Debian 4.0
 PHP Version:  5.3CVS-2009-01-09 (snap)
-Assigned To:  
+Assigned To:  scottmac
 New Comment:

What was the configure line you were using?


Previous Comments:


[2009-01-09 15:28:47] giovanni at giacobbi dot net

Description:

During the final linking of sapi/cli/php I get the following errors.
Adding "-licui18n" solves the problem.

ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuNext':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100648:
undefined reference to `ubrk_current_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100649:
undefined reference to `ubrk_next_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100677:
undefined reference to `u_strToUTF8_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100656:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuClose':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100622:
undefined reference to `ubrk_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeCompare':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100043:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100091:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100092:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100093:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100064:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100075:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100082:
undefined reference to `utf8_countTrailBytes_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeFunc':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100143:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuOpen':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100590:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100599:
undefined reference to `utf8_nextCharSafeBody_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100605:
undefined reference to `ubrk_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100612:
undefined reference to `ubrk_first_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100587:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuFunctionError':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100169:
undefined reference to `u_errorName_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLoadCollation':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100388:
undefined reference to `ucol_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100399:
undefined reference to `ucol_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCollationColl':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100345:
undefined reference to `ucol_strcoll_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCaseFunc16':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100310:
undefined reference to `u_strToUpper_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100312:
undefined reference to `u_strToLower_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuRegexpFunc':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100233:
undefined reference to `uregex_setText_3_6'


/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100221:
undefined reference to `uregex_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100240:
undefined reference to `uregex_matches_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100251:
undefined reference to 

#47055 [NEW]: Compilation errors in ext/sqlite3/libsqlite

2009-01-09 Thread giovanni at giacobbi dot net
From: giovanni at giacobbi dot net
Operating system: Linux Debian 4.0
PHP version:  5.3CVS-2009-01-09 (snap)
PHP Bug Type: Compile Failure
Bug description:  Compilation errors in ext/sqlite3/libsqlite

Description:

During the final linking of sapi/cli/php I get the following errors.
Adding "-licui18n" solves the problem.

ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuNext':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100648:
undefined reference to `ubrk_current_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100649:
undefined reference to `ubrk_next_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100657:
undefined reference to `u_isspace_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100677:
undefined reference to `u_strToUTF8_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100656:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuClose':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100622:
undefined reference to `ubrk_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeCompare':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100043:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100091:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100092:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100093:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100064:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100075:
undefined reference to `utf8_countTrailBytes_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100082:
undefined reference to `utf8_countTrailBytes_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLikeFunc':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100143:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuOpen':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100590:
undefined reference to `u_foldCase_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100599:
undefined reference to `utf8_nextCharSafeBody_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100605:
undefined reference to `ubrk_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100612:
undefined reference to `ubrk_first_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100587:
undefined reference to `utf8_nextCharSafeBody_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuFunctionError':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100169:
undefined reference to `u_errorName_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuLoadCollation':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100388:
undefined reference to `ucol_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100399:
undefined reference to `ucol_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCollationColl':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100345:
undefined reference to `ucol_strcoll_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCaseFunc16':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100310:
undefined reference to `u_strToUpper_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100312:
undefined reference to `u_strToLower_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuRegexpFunc':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100233:
undefined reference to `uregex_setText_3_6'


/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100221:
undefined reference to `uregex_open_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100240:
undefined reference to `uregex_matches_3_6'
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100251:
undefined reference to `uregex_setText_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuCollationDel':
/home/johnny/build/php5.3-200901091330/ext/sqlite3/libsqlite/sqlite3.c:100329:
undefined reference to `ucol_close_3_6'
ext/sqlite3/libsqlite/.libs/sqlite3.o: In function `icuRegexpDelete':
/home/johnny/build/php5.3-20

#47054 [NEW]: BC break in static functions called as dynamic

2009-01-09 Thread giovanni at giacobbi dot net
From: giovanni at giacobbi dot net
Operating system: linux
PHP version:  5.3CVS-2009-01-09 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  BC break in static functions called as dynamic

Description:

See the example code, should be self explanatory. The same code *works as
expected* in php5.3-alpha3, but does not with php5.3-200901091330.


Reproduce code:
---
class C {
  final protected static function s() {
print "Called class: " . get_called_class() . "\n";
  }
}
class D extends C {
  public function m() {
$this->s();
  }
}

$d = new D();
$d->m();


Expected result:

Called class: D


Actual result:
--
Warning: get_called_class() called from outside a class in
/home/johnny/build/php5.3-200901091330/- on line 4
Called class: 


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



#43314 [Com]: iconv_mime_encode(), broken Q scheme

2009-01-09 Thread om at viazenetti dot de
 ID:   43314
 Comment by:   om at viazenetti dot de
 Reported By:  wiela at centras dot lt
 Status:   No Feedback
 Bug Type: ICONV related
 Operating System: Windows XP HE
 PHP Version:  5.2.5
 New Comment:

Hm, is this bugged fixed in newer versions? Currently we are using
version 5.2.6 and the error still occures.


Previous Comments:


[2008-11-04 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2008-10-27 12:56:37] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-02-01 14:10:33] d_kelsey at uk dot ibm dot com

I encountered a similar problem with another utf-8 string, and although
this may not be the best way to fix it, this change provides a
workaround.

in iconv.c (line 1281 in php5.2.5) the line
out_size -= ((nbytes_required - (char_cnt - 2)) + 1) / (3 - 1);

should be changed to
out_size -= ((nbytes_required - (char_cnt - 2)) + 1) / 3;

It looks like the code attempts to determine how many characters would
fit into output buffer when converted (given that it has gone over the
limit), but it assumes that on average each character uses 2 bytes (ie
an even mixture of encoded and printable characters). A lot of strings
will be greater than this and out_size will be set to a very large
positive number (as it subtracts a larger number from out_size and being
unsigned will result in a large positive number).
The workaround is to take the worst case scenario and assume all
characters generated 3 bytes (ie all encoded).



[2007-11-16 16:23:17] wiela at centras dot lt

Description:

iconv_mime_encode(),'Q' encoding scheme isn't reliable and 
sometimes (for particular character and/or string length combination?)
returns: "Notice: iconv_mime_encode(): Unknown error (7) in ..."
*without any result*. 

This also applies to earlier php versions (tested with php 5.2.1).



Reproduce code:
---
$preferences = array(
"input-charset" => "UTF-8",
"output-charset" => "UTF-8",
"line-length" => 76,
"line-break-chars" => "\n",
"scheme" => "Q"
);

// $str1 results error, it's utf-8 string, its base64_encode() is: 
//'xIXEjcSZxJfEr8WhxbPFviDEr8SZxI3FocWzxJnEr8SFIMSNxJnFs8SFxaHFs8Wr'
$str1 = "ąčęėįšųž
įęčšųęįą
čęųąšųū"; 

// $str2 doesn't result error, although it's only one character
// shorter. It's utf-8 string, its base64_encode() is: 
//'xIXEjcSZxJfEr8WhxbPFviDEr8SZxI3FocWzxJnEr8SFIMSNxJnFs8SFxaHFsw=='
$str2 = "ąčęėįšųž
įęčšųęįą
čęųąšų";

echo iconv_mime_encode("Subject", $str1, $preferences);
echo iconv_mime_encode("Subject", $str2, $preferences);


Expected result:

Well, at least any (*some*) result is expected, without any 
errors and warnings. 

For $str1 is expected:
Subject: =?UTF-8?Q?=C4=85=C4=8D=C4=99=C4=97=C4=AF=C5=A1=C5=B3?=
 =?UTF-8?Q?=C5=BE=20=C4=AF=C4=99=C4=8D=C5=A1=C5=B3=C4=99=C4=AF?=
 =?UTF-8?Q?=C4=85=20=C4=8D=C4=99=C5=B3=C4=85=C5=A1=C5=B3=C5=AB?=

For $str2 is expected:
Subject: =?UTF-8?Q?=C4=85=C4=8D=C4=99=C4=97=C4=AF=C5=A1=C5=B3?=
 =?UTF-8?Q?=C5=BE=20=C4=AF=C4=99=C4=8D=C5=A1=C5=B3=C4=99=C4=AF?=
 =?UTF-8?Q?=C4=85=20=C4=8D=C4=99=C5=B3=C4=85=C5=A1=C5=B3?=

Actual result:
--
For $str1: 
FALSE with "Notice: iconv_mime_encode(): Unknown error (7) in ..."


For $str2:
Subject: =?UTF-8?Q?=C4=85=C4=8D=C4=99=C4=97=C4=AF=C5=A1=C5=B3?=
 =?UTF-8?Q?=C5=BE=20=C4=AF=C4=99=C4=8D=C5=A1=C5=B3=C4=99=C4=AF?=
 =?UTF-8?Q?=C4=85=20=C4=8D=C4=99=C5=B3=C4=85=C5=A1=C5=B3?=





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



#47053 [NEW]: empty($FRED) returns false incorrectly

2009-01-09 Thread mc at cowensw dot cxo dot uk
From: mc at cowensw dot cxo dot uk
Operating system: Linux
PHP version:  6CVS-2009-01-09 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description:  empty($FRED) returns false incorrectly

Description:

Hosting moved to new version 8-1-2009.  Since then in certain situations
the empty() function now returns wrong value.  Argument holds space, but
function returns "not empty".

Tested all normal empty functions, and they are OK
(http://www.dev.holidaynetwork.co.uk/Test3.php)

In this case $purchaseToken is derived from a row in a Session Variable.

I have tried to reproduce this with smaller simpler scripts, but with no
success.





Reproduce code:
---
Sample extract from script:
echo '  purchaseToken7>>'.$purchaseToken7.'<< ';
echo '  rhf>>'.$rhf.'<< ';
echo '  $_SESSION["Sess_purchaseToken7"] array   >>';
print_r($_SESSION["Sess_purchaseToken7"]); echo '<< ';
echo '  $_SESSION["Sess_purchaseToken7"][$rhf] array  
>>'.$_SESSION["Sess_purchaseToken7"][$rhf].'<< ';
echo '  strlen(purchaseToken7)>>'.strlen($purchaseToken7).'<< ';
echo '  bin2hex(purchaseToken7)>>'.bin2hex($purchaseToken7).'<<
';

if (!empty($purchaseToken7) ) echo "purchaseToken not empty"; else
echo "purchaseToken  empty" ;
if (empty($purchaseToken7) ) echo "purchaseToken empty"; else echo
"purchaseToken not empty ";
$ShowDiag = 0;
exit()



Expected result:

Sample Output
Shows  variable purchaseToken is space,
However empty function returns "not empty"

purchaseToken7 >> << 
rhf >>9<< 
$_SESSION["Sess_purchaseToken7"] array >>Array ( [0] => 0 [1] => [2] =>
[3] => 0 [4] => 0 [5] => [6] => [7] => [8] => [9] => ) << 
$_SESSION["Sess_purchaseToken7"][$rhf] array >> << 
strlen(purchaseToken7) >>1<< 
bin2hex(purchaseToken7) >>20<< 
purchaseToken empty
purchaseToken empty 

Actual result:
--
Sample Output
Shows  variable purchaseToken is space,
However empty function returns "not empty"

purchaseToken7 >> << 
rhf >>9<< 
$_SESSION["Sess_purchaseToken7"] array >>Array ( [0] => 0 [1] => [2] =>
[3] => 0 [4] => 0 [5] => [6] => [7] => [8] => [9] => ) << 
$_SESSION["Sess_purchaseToken7"][$rhf] array >> << 
strlen(purchaseToken7) >>1<< 
bin2hex(purchaseToken7) >>20<< 
purchaseToken not empty
purchaseToken not empty 

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



#46653 [Asn->Csd]: mysqlnd: can't extend mysqli

2009-01-09 Thread johannes
 ID:   46653
 Updated by:   johan...@php.net
 Reported By:  s dot tretter at szene1 dot at
-Status:   Assigned
+Status:   Closed
 Bug Type: MySQLi related
 Operating System: linux
 PHP Version:  5.3CVS-2008-11-23 (CVS)
 Assigned To:  mysql
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2008-11-25 09:27:36] and...@php.net

doesn't work with mysqli/libmysql (the same output)



[2008-11-23 12:59:07] s dot tretter at szene1 dot at

Description:

If you extend a class with mysqli (using the mysqlnd driver) and try to
connect to the database, php produces strange error messages.
PHP 5.3.0alpha3-dev (cli) (built: Nov 23 2008 12:06:30) 
and --with-mysqli=mysqlnd

In php 5.2 and lower this test class works perfect.

Reproduce code:
---
 'localhost',
  'DB_USER' => 'db',
  'DB_PASS' => '',
  'DB_NAME' => 'test'
 );
$this->init();
$this->options(MYSQLI_OPT_CONNECT_TIMEOUT, 1);

$this->real_connect($dbParam['DB_HOST'],
   
$dbParam['DB_USER'],
   
$dbParam['DB_PASS'],
   
$dbParam['DB_NAME']);
}
}


$mysqli = new a();
printf ("Connection: %s\n.", $mysqli->host_info);
$mysqli->close();
?>

Expected result:

should work like in php5.2

Actual result:
--
Warning: mysqli::options() [mysqli.options]: Couldn't fetch a in
test.php on line 31
Warning: mysqli::real_connect() [mysqli.real-connect]: Couldn't fetch
test.php on line 41





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



#47051 [NEW]: pg_fetch_object does not convert to literal PHP booleans

2009-01-09 Thread germ dot van dot eck at gmail dot com
From: germ dot van dot eck at gmail dot com
Operating system: Linux, Ubuntu 8.04
PHP version:  5.2.8
PHP Bug Type: PostgreSQL related
Bug description:  pg_fetch_object does not convert to literal PHP booleans

Description:

Postgresql booleans are internally stored as either 'f' or 't' (False or
True).
On retrieval using pg_fetch_object, they are simply retrieved as PHP
strings, rather than either 0 or 1, or even better, false or true.
This causes that postgresql.
I am not sure, but I think in the data returned by the server, there is
metadata explaining the field types and so they could be automatically
converted to PHP bools.
This is from a bugreport and related forum topic that was made for the
CodeIgniter framework.
Bugreport (slighly unrelated CI bug, but this issue was discussed in the
comments):
http://codeigniter.com/bug_tracker/bug/6303/
Forum topic:
http://codeigniter.com/forums/viewthread/101001/


Reproduce code:
---
test."\n";
pg_query('DROP TABLE test');
?>


Expected result:

1

Actual result:
--
t

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



#47050 [NEW]: mysqli_poll() modifies improper variables

2009-01-09 Thread vr...@php.net
From: vr...@php.net
Operating system: Windows
PHP version:  5.3.0alpha3
PHP Bug Type: MySQLi related
Bug description:  mysqli_poll() modifies improper variables

Description:

mysqli_poll() modifies the variable which was assigned to variables passed
to mysqli_poll().

The reason probably is that mysqli_poll() doesn't copy zvals on write as
it should.

Reproduce code:
---
query("SELECT 'test'", MYSQLI_ASYNC);
$all_links = array($link1);
$links = $errors = $reject = $all_links;
mysqli_poll($links, $errors, $reject, 1);
print_r($all_links);


Expected result:

Array
(
[0] => mysqli Object
)

Actual result:
--
Array
(
)


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



#47049 [Opn->Fbk]: SoapClient::__soapCall causes a segmentation fault.

2009-01-09 Thread scottmac
 ID:   47049
 Updated by:   scott...@php.net
 Reported By:  uli dot staerk at globalways dot net
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux 2.6.16
 PHP Version:  5.2.8
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:


[2009-01-09 12:45:47] uli dot staerk at globalways dot net

WSDL: http://uli-staerk.de/temp/report.wsdl

You will need to fill in valid service-address.



[2009-01-09 11:47:46] uli dot staerk at globalways dot net

Description:

I cant not give you any further information as the example shows.

Reproduce code:
---
'; print_r($str); echo ''; }

try {
$client = new SoapClient('reporter.wsdl',
array('trace' => 1 , 'exceptions' => true)
);
//  debug(debug($client->__getFunctions())); // works

$host = array('uuid' => 'foo');
$software_list = array(array('name' => 'package', 'version' =>
'1.2.3', 'state' => 'installed'));
$updates = array();

$report_id =
$client->__soapCall('reportSoftwareStatus',array($host, $software_list,
$updates));

}
catch (Exception $e) {
debug((string)$e);
}

Expected result:

segmentation fault

Actual result:
--
error message ;)





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



#47035 [Opn]: dns_get_record returns a garbage byte at the end of a TXT record

2009-01-09 Thread pajoye
 ID:   47035
 Updated by:   paj...@php.net
 Reported By:  valli at icsurselva dot ch
 Status:   Open
 Bug Type: Network related
 Operating System: gentoo
 PHP Version:  5.2.8
 Assigned To:  felipe
 New Comment:

I agree, it would be more logical to return an array of strings.

Comments?


Previous Comments:


[2009-01-09 11:36:01] valli at icsurselva dot ch

Hello again,
I just dicovered that the garbage chars not
only appear at the end of a TXT record.
Example:
 nslookup -type=TXT 82.19.186.195.aspath.routeviews.org
 Returns: text = "13237 3303 44038" "195.186.0.0" "17"

This DNS request returns 3 Strings.
If I do this with dns_get_record the strings are concatenated
(containing a garbage char between the strings)

BTW: Is it really a good idea to concatenate this strings?
 Wouldn't it better to return a array containing this strings?
 Example: the anwers from routeviews.org are really
  hard (if not impossible) to parse in this way:
  "13237 3303 44038195.186.0.017"
  it would be better in this way:
  array("13237 3303 44038","195.186.0.0","17")



[2009-01-08 17:20:39] fel...@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks.



[2009-01-08 10:45:05] paj...@php.net

Felipe, can you give it a try please?

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7&r2=1.70.2.7.2.7&pathrev=PHP_5_2





[2009-01-08 09:31:41] valli at icsurselva dot ch

Here's my current workaround:

$rt = @dns_get_record($lookuphost, DNS_ANY);
// workaround for http://bugs.php.net/bug.php?id=47035
if (substr(PHP_VERSION,0,strpos(PHP_VERSION, '-')) == '5.2.8') {
for($i = 0, $rts = sizeof($rt); $i < $rts; ++$i) {
if ($rt[$i]['type'] == 'TXT') {
// remove last byte
$rt[$i]['txt'] = substr($rt[$i]['txt'], 0, -1);
}
}
}



[2009-01-08 09:07:24] valli at icsurselva dot ch

Description:

The last byte of a TXT record returned by dns_get_record
is garbage.


Reproduce code:
---
$rt = dns_get_record('82.19.186.195.countries.blackholes.us',
DNS_TXT);
$txt = $rt[0]['txt'];
print $txt." (".strlen($txt).")\n";
foreach(str_split($txt) as $char) {
print "$char\t".ord($char)."\n";
}


Expected result:

ch (2)
c   99
h   104


Actual result:
--
ch (3)
c   99
h   104
128






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



#47049 [Com]: SoapClient::__soapCall causes a segmentation fault.

2009-01-09 Thread uli dot staerk at globalways dot net
 ID:   47049
 Comment by:   uli dot staerk at globalways dot net
 Reported By:  uli dot staerk at globalways dot net
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Linux 2.6.16
 PHP Version:  5.2.8
 New Comment:

WSDL: http://uli-staerk.de/temp/report.wsdl

You will need to fill in valid service-address.


Previous Comments:


[2009-01-09 11:47:46] uli dot staerk at globalways dot net

Description:

I cant not give you any further information as the example shows.

Reproduce code:
---
'; print_r($str); echo ''; }

try {
$client = new SoapClient('reporter.wsdl',
array('trace' => 1 , 'exceptions' => true)
);
//  debug(debug($client->__getFunctions())); // works

$host = array('uuid' => 'foo');
$software_list = array(array('name' => 'package', 'version' =>
'1.2.3', 'state' => 'installed'));
$updates = array();

$report_id =
$client->__soapCall('reportSoftwareStatus',array($host, $software_list,
$updates));

}
catch (Exception $e) {
debug((string)$e);
}

Expected result:

segmentation fault

Actual result:
--
error message ;)





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



#47049 [NEW]: SoapClient::__soapCall causes a segmentation fault.

2009-01-09 Thread uli dot staerk at globalways dot net
From: uli dot staerk at globalways dot net
Operating system: Linux 2.6.16
PHP version:  5.2.8
PHP Bug Type: Reproducible crash
Bug description:  SoapClient::__soapCall causes a segmentation fault.

Description:

I cant not give you any further information as the example shows.

Reproduce code:
---
'; print_r($str); echo ''; }

try {
$client = new SoapClient('reporter.wsdl',
array('trace' => 1 , 'exceptions' => true)
);
//  debug(debug($client->__getFunctions())); // works

$host = array('uuid' => 'foo');
$software_list = array(array('name' => 'package', 'version' =>
'1.2.3', 'state' => 'installed'));
$updates = array();

$report_id =
$client->__soapCall('reportSoftwareStatus',array($host, $software_list,
$updates));

}
catch (Exception $e) {
debug((string)$e);
}

Expected result:

segmentation fault

Actual result:
--
error message ;)

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



#47048 [NEW]: php5-pgsql segfaults with new pg_meta_data

2009-01-09 Thread ml-php dot net at bettercom dot de
From: ml-php dot net at bettercom dot de
Operating system: FreeBSD 7.0-RELEASE
PHP version:  5.2.8
PHP Bug Type: PostgreSQL related
Bug description:  php5-pgsql segfaults with new pg_meta_data

Description:

The last changes php_pgsql_meta_data cause segfaults in client and 
mod_php5

Reproduce code:
---



Actual result:
--
(gdb) bt
#0  0x28606b20 in php_pgsql_meta_data () 
from /usr/local/lib/php/20060613/pgsql.so
#1  0x2860c49b in zif_pg_meta_data () 
from /usr/local/lib/php/20060613/pgsql.so
#2  0x0818be08 in zend_do_fcall_common_helper_SPEC ()
#3  0x0817d639 in execute ()
#4  0x0815ffc2 in zend_execute_scripts ()
#5  0x0811e7b5 in php_execute_script ()
#6  0x081db5e7 in main ()


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



#47035 [Csd->Opn]: dns_get_record returns a garbage byte at the end of a TXT record

2009-01-09 Thread valli at icsurselva dot ch
 ID:   47035
 User updated by:  valli at icsurselva dot ch
 Reported By:  valli at icsurselva dot ch
-Status:   Closed
+Status:   Open
 Bug Type: Network related
 Operating System: gentoo
 PHP Version:  5.2.8
 Assigned To:  felipe
 New Comment:

Hello again,
I just dicovered that the garbage chars not
only appear at the end of a TXT record.
Example:
 nslookup -type=TXT 82.19.186.195.aspath.routeviews.org
 Returns: text = "13237 3303 44038" "195.186.0.0" "17"

This DNS request returns 3 Strings.
If I do this with dns_get_record the strings are concatenated
(containing a garbage char between the strings)

BTW: Is it really a good idea to concatenate this strings?
 Wouldn't it better to return a array containing this strings?
 Example: the anwers from routeviews.org are really
  hard (if not impossible) to parse in this way:
  "13237 3303 44038195.186.0.017"
  it would be better in this way:
  array("13237 3303 44038","195.186.0.0","17")


Previous Comments:


[2009-01-08 17:20:39] fel...@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks.



[2009-01-08 10:45:05] paj...@php.net

Felipe, can you give it a try please?

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7&r2=1.70.2.7.2.7&pathrev=PHP_5_2





[2009-01-08 09:31:41] valli at icsurselva dot ch

Here's my current workaround:

$rt = @dns_get_record($lookuphost, DNS_ANY);
// workaround for http://bugs.php.net/bug.php?id=47035
if (substr(PHP_VERSION,0,strpos(PHP_VERSION, '-')) == '5.2.8') {
for($i = 0, $rts = sizeof($rt); $i < $rts; ++$i) {
if ($rt[$i]['type'] == 'TXT') {
// remove last byte
$rt[$i]['txt'] = substr($rt[$i]['txt'], 0, -1);
}
}
}



[2009-01-08 09:07:24] valli at icsurselva dot ch

Description:

The last byte of a TXT record returned by dns_get_record
is garbage.


Reproduce code:
---
$rt = dns_get_record('82.19.186.195.countries.blackholes.us',
DNS_TXT);
$txt = $rt[0]['txt'];
print $txt." (".strlen($txt).")\n";
foreach(str_split($txt) as $char) {
print "$char\t".ord($char)."\n";
}


Expected result:

ch (2)
c   99
h   104


Actual result:
--
ch (3)
c   99
h   104
128






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



#46990 [Opn->Asn]: Passing UTF8 strings to filesystem functions produce wrong filenames

2009-01-09 Thread pajoye
 ID:   46990
 Updated by:   paj...@php.net
 Reported By:  alex dot bazan at concatel dot com
-Status:   Open
+Status:   Assigned
 Bug Type: *Directory/Filesystem functions
 Operating System: win32 only - Windows XP
 PHP Version:  5.2.8
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

Can't be fixed in 5.2 neither in 5.3. It will work smoothly in 6.x
(unicode support).


Previous Comments:


[2009-01-09 10:54:13] alex dot bazan at concatel dot com

For anyone stumbling upon this bug, i wrote a workaround building a
wrapper for filesystem functions. This workaround will will not fix the
issue completely but will work with latin compatible characters when
using UTF8 as the string encoding. People using other characters
(japanese, chinese, hebrew ...) will still have problems.


CODE:


/**
 * Wrapper for PHP filesystem functions
 */
class Fsw {

/**
 * Returns the filename for use with filesystem functions
 */
static function setName ($file) {
if (DIRECTORY_SEPARATOR=="\\") {
$file=utf8_decode($file);
}
return $file;
}

/**
 * Encondes the filename returned by filesystem functions
 */
static function getName ($file) {
if (DIRECTORY_SEPARATOR=="\\") {
$file=utf8_encode($file);
}
return $file;
}


static function file_exists ($filename) {
return file_exists(self::setName($filename));
}

static function fopen ($filename,$mode) {
return fopen(self::setName($filename),$mode);
}

static function opendir ($dirname) {
return opendir(self::setName($dirname));
}

static function readdir ($dir_handle) {
$file=readdir($dir_handle);
if ($file) {
// check if file is found before converting it's
// name or we will convert bool(false) to string
$file=self::getName($file);
}
return $file;
}

// just create any other filesystem function you might use in your code
here

}



[2009-01-03 13:25:07] j...@php.net






[2009-01-02 08:06:39] alex dot bazan at concatel dot com

The UTF string did not get saved correctly in the bug report. It was a
japanese string.



[2009-01-02 08:03:37] alex dot bazan at concatel dot com

Description:

Under Windows, when I use fpoen() or mkdir() with a UTF8 encoded
string, the file or directory name is not converted to the filesystem
encoding and thus the file or directory is created with a wrong file
name.

Reproduce code:
---


Expected result:

Directory 日本語 should be created

Actual result:
--
Directory 日本語 is created





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



#46990 [Opn]: Passing UTF8 strings to filesystem functions produce wrong filenames

2009-01-09 Thread alex dot bazan at concatel dot com
 ID:   46990
 User updated by:  alex dot bazan at concatel dot com
 Reported By:  alex dot bazan at concatel dot com
 Status:   Open
 Bug Type: *Directory/Filesystem functions
 Operating System: win32 only - Windows XP
 PHP Version:  5.2.8
 New Comment:

For anyone stumbling upon this bug, i wrote a workaround building a
wrapper for filesystem functions. This workaround will will not fix the
issue completely but will work with latin compatible characters when
using UTF8 as the string encoding. People using other characters
(japanese, chinese, hebrew ...) will still have problems.


CODE:


/**
 * Wrapper for PHP filesystem functions
 */
class Fsw {

/**
 * Returns the filename for use with filesystem functions
 */
static function setName ($file) {
if (DIRECTORY_SEPARATOR=="\\") {
$file=utf8_decode($file);
}
return $file;
}

/**
 * Encondes the filename returned by filesystem functions
 */
static function getName ($file) {
if (DIRECTORY_SEPARATOR=="\\") {
$file=utf8_encode($file);
}
return $file;
}


static function file_exists ($filename) {
return file_exists(self::setName($filename));
}

static function fopen ($filename,$mode) {
return fopen(self::setName($filename),$mode);
}

static function opendir ($dirname) {
return opendir(self::setName($dirname));
}

static function readdir ($dir_handle) {
$file=readdir($dir_handle);
if ($file) {
// check if file is found before converting it's
// name or we will convert bool(false) to string
$file=self::getName($file);
}
return $file;
}

// just create any other filesystem function you might use in your code
here

}


Previous Comments:


[2009-01-03 13:25:07] j...@php.net






[2009-01-02 08:06:39] alex dot bazan at concatel dot com

The UTF string did not get saved correctly in the bug report. It was a
japanese string.



[2009-01-02 08:03:37] alex dot bazan at concatel dot com

Description:

Under Windows, when I use fpoen() or mkdir() with a UTF8 encoded
string, the file or directory name is not converted to the filesystem
encoding and thus the file or directory is created with a wrong file
name.

Reproduce code:
---


Expected result:

Directory 日本語 should be created

Actual result:
--
Directory 日本語 is created





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



#35799 [Opn->Csd]: Add getopt to Windows Platform

2009-01-09 Thread kalle
 ID:   35799
 Updated by:   ka...@php.net
 Reported By:  jthompsonic at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: Windows
 PHP Version:  5.1.2RC1
 New Comment:

Added in 5.3


Previous Comments:


[2005-12-25 03:28:12] jthompsonic at gmail dot com

Description:

getopt() is an easy function to implement and would be quite useful for
Windows users who are writing CLI programs.  Please add getopt() for
Windows users.






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



#47047 [Com]: _SERVER["REQUEST_MTIME"]

2009-01-09 Thread lunter at interia dot pl
 ID:   47047
 Comment by:   lunter at interia dot pl
 Reported By:  lunter at interia dot pl
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  5.3.0alpha3
 New Comment:

or better name: _SERVER["REQUEST_UTIME"]


Previous Comments:


[2009-01-09 10:30:19] lunter at interia dot pl

Description:

_SERVER["REQUEST_MTIME"]

New SERVER variable with microtime(true) of request time

very useful to calculate page generating time in micro-seconds.






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



#47047 [NEW]: _SERVER["REQUEST_MTIME"]

2009-01-09 Thread lunter at interia dot pl
From: lunter at interia dot pl
Operating system: all
PHP version:  5.3.0alpha3
PHP Bug Type: Feature/Change Request
Bug description:  _SERVER["REQUEST_MTIME"]

Description:

_SERVER["REQUEST_MTIME"]

New SERVER variable with microtime(true) of request time

very useful to calculate page generating time in micro-seconds.


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



#47046 [NEW]: Ass equivalent of array_merge() for SplObjectStorage

2009-01-09 Thread karsten at typo3 dot org
From: karsten at typo3 dot org
Operating system: Mac OS X 10.5.6
PHP version:  5.3.0alpha3
PHP Bug Type: Feature/Change Request
Bug description:  Ass equivalent of array_merge() for SplObjectStorage

Description:

SplObjectStorage is a great replacement for arrays when it comes to 
storing objects. But with arrays one could use array_merge to combine 
sets, for SplObjectStorage there is no such simple way. Resorting to a 
foreach/attach loop seems cumbersome and is probably slower than an 
internal solution would be.

I could imagine to have a merge() method on SplObjectStorage. It should 
directly modify the called object by merging the given argument.


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



#33149 [Opn->Csd]: function inet_pton unavailable

2009-01-09 Thread kalle
 ID:   33149
 Updated by:   ka...@php.net
 Reported By:  h dot warmelink at planet dot nl
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: Windows XP
 PHP Version:  5CVS-2005-05-26 (dev)
-Assigned To:  
+Assigned To:  Kalle
 New Comment:

This have been implemented on Windows in 5.3


Previous Comments:


[2005-05-26 19:24:50] nlop...@php.net

I've added a note about windows to the manual.
In fact the function was added in PHP 5.1, so we have a bug in
functable.



[2005-05-26 15:36:40] tony2...@php.net

Jakub, could you plz point me where inet_pton() is placed in 5.0 ?
I can find it in HEAD (see ext/standard/basic_functions.c), but it
doesn't exist in 5.0.



[2005-05-26 14:09:10] w...@php.net

Actually, windows doesn't support this right now, but could (requires a
little bit of glue).
Making this a change request--but having accurate docs would be good
too.



[2005-05-26 13:29:08] vr...@php.net

They are available in PHP 5.0 too but they are available only if
HAVE_INET_NTOP or HAVE_INET_NTOP is defined.



[2005-05-26 12:14:14] tony2...@php.net

Both inet_pton() and inet_ntop() are available only in HEAD (i.e. PHP
5.1).



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/33149

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



#47045 [NEW]: Bug when comparing SplObjectStorage instances

2009-01-09 Thread karsten at typo3 dot org
From: karsten at typo3 dot org
Operating system: Mac OS X 10.5.6
PHP version:  5.3.0alpha3
PHP Bug Type: SPL related
Bug description:  Bug when comparing SplObjectStorage instances

Description:

Two instances of SplObjectStorage should be considered equal only if 
they contain the same objects, when using == for comparison.

Reproduce code:
---
attach($someObject);

var_dump($objectStorage === $objectStorage1); // FALSE, fine
var_dump($objectStorage == $objectStorage1); // TRUE, huh?

$objectStorage1->attach($someObject);

var_dump($objectStorage === $objectStorage1); // FALSE, fine
var_dump($objectStorage == $objectStorage1); // TRUE, fine

?>


Expected result:

bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)


Actual result:
--
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)


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



#44996 [Com]: xmlrpc_decode ignores time zone on iso8601.datetime

2009-01-09 Thread kawai at apache dot org
 ID:   44996
 Comment by:   kawai at apache dot org
 Reported By:  helixpip at gmail dot com
 Status:   Open
 Bug Type: XMLRPC-EPI related
 Operating System: Windows 2000
 PHP Version:  5.2.7
 New Comment:

Following is a patch for timezone problem.

The patch will fix the bug even if xmlrpc-epi did not parse timezone 
correctly. xmlrpc-epi should be patched as 
http://sourceforge.net/tracker2/?
func=detail&aid=2495315&group_id=23199&atid=377730.

--- ext/xmlrpc/xmlrpc-epi-php.c.orig2008-07-19 02:34:07.0 
+0900
+++ ext/xmlrpc/xmlrpc-epi-php.c 2009-01-10 03:39:19.0 +0900
@@ -1300,7 +1300,7 @@
if(newtype == xmlrpc_datetime) {
XMLRPC_VALUE v = 
XMLRPC_CreateValueDateTime_ISO8601(NULL, value->value.str.val);
if(v) {
-   time_t timestamp = 
XMLRPC_GetValueDateTime(v);
+   time_t timestamp = 
(time_t)php_parse_date(XMLRPC_GetValueDateTime_ISO8601(v), NULL);
if(timestamp) {
zval* ztimestamp;


Previous Comments:


[2008-12-05 17:01:43] helixpip at gmail dot com

Just tested with 5.2.7.  The behavior has changed, but it's still not
working correctly.  The 'scalar' property now returns the original text
of the string passed in the  tags, which is good.  The
conversion of this string to a timestamp that is stored in the
'timestamp' property still appears to be ignoring the timezone
designator, however.  Previously, it ignored the timezone designator and
assumed local time.  Now, it appears to ignore the timezone designator
and assume Zulu time.  Strtotime() still gives the correct timestamp in
all cases.  Results of tests:

ISO 8601 datetime 20010909T01:46:40Z
strtotime yields 10
xmlrpc_decode
yields stdClass Object
(
[scalar] => 20010909T01:46:40Z
[xmlrpc_type] => datetime
[timestamp] => 10
)

ISO 8601 datetime 20010909T00:46:40-01
strtotime yields 10
xmlrpc_decode
yields stdClass Object
(
[scalar] => 20010909T00:46:40-01
[xmlrpc_type] => datetime
[timestamp] => 96400
)

ISO 8601 datetime 2001-09-09T08:46:40+07:00
strtotime yields 10
xmlrpc_decode
yields stdClass Object
(
[scalar] => 2001-09-09T08:46:40+07:00
[xmlrpc_type] => datetime
[timestamp] => 125200
)

ISO 8601 datetime 2001-09-08T21:46:40-0400
strtotime yields 10
xmlrpc_decode
yields stdClass Object
(
[scalar] => 2001-09-08T21:46:40-0400
[xmlrpc_type] => datetime
[timestamp] => 85600
)



[2008-10-24 16:00:17] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

IIRC, this was fixed..



[2008-06-05 05:28:57] kawai at apache dot org

Now, you can download patched version of xmlrpc extension from:
http://mp.i-revo.jp/user.php/kcvcrlkq/entry/313.html

I hope this patch to be applied in the next PHP release.



[2008-05-14 18:14:24] helixpip at gmail dot com

I wrote:
>Ideally the scalar property should explicitly be 
>a UTC ISO 8601 datetime value, ending with the 
>time zone designator 'Z'.

On second thought, it might be more useful for a php script to know
what, if any, time zone designator appeared with the original iso8601
datetime value. (At the moment there's no way to find this information
without parsing the xml.) If the scalar property preserved the original
time zone designator, that would help with this.



[2008-05-14 17:47:07] helixpip at gmail dot com

Description:

The xmlrpc_decode function does not correctly interpret ISO 8601
timezone designations when interpreting XML-RPC datetime values passed
in  tags.  It appears that the time zone designator is
completely ignored and the local time zone is assumed.  (The
xmlrpc_decode_request function shows the same behavior.)

A side effect of this bug is that the 'scalar' and 'timestamp' objects
returned for XML-RPC datetime values will disagree if the object is used
is used in a different time zone than it was created.  Ideally the
scalar property should explicitly be a UTC ISO 8601 datetime value,
ending with the time zone designator 'Z'.

Reproduce code:
---
function DecodeDatetime($datetime) {
  print "\nISO 8601 datetime $datetime\n";
  print "strtotime yields " . strtotime($datetime) . "\nxmlrpc_decode
yields ";
  $obj = xmlrpc_decode("$datetime");
  print_r($obj);
}

DecodeDatetime("20010909T01:4