#40064 [NEW]: Wrong fieldnames in result (including table alias names)

2007-01-08 Thread christoph at ziegenberg dot de
From: christoph at ziegenberg dot de
Operating system: Windows XP SP2
PHP version:  5.2.0
PHP Bug Type: PDO related
Bug description:  Wrong fieldnames in result (including table alias names)

Description:

If you get the data of a query like "SELECT tablealias.fieldname FROM
table tablealias.fieldname GROUP BY tablealias.fieldname" the result array
contains not only the field name, but also the table alias name as field
name.

Only using "SELECT tablealias.fieldname AS fieldname..." fixes this
problem, but this should not be neccessary.

I don't know if this is a PDO or SQLite problem.

Reproduce code:
---
query("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT)");
$sldb->query("INSERT INTO test (id) VALUES (1)");

$queries = array();
$queries[] = "SELECT id FROM test";
$queries[] = "SELECT t1.id FROM test t1";
$queries[] = "SELECT t1.id FROM test t1 GROUP BY t1.id";
$queries[] = "SELECT t1.id AS id FROM test t1 GROUP BY t1.id";

foreach ($queries as $query)
{
$stmt = $sldb->prepare($query);
$stmt->execute();

if ($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
echo 'result for query "' . $query . '":';
print_r($row);
echo '';
}
}
?>

Expected result:

result for query "SELECT id FROM test":
Array ( [id] => 1 )

result for query "SELECT t1.id FROM test t1":
Array ( [id] => 1 )

result for query "SELECT t1.id FROM test t1 GROUP BY t1.id":
Array ( [id] => 1 )

result for query "SELECT t1.id AS id FROM test t1 GROUP BY t1.id":
Array ( [id] => 1 ) 

Actual result:
--
result for query "SELECT id FROM test":
Array ( [id] => 1 )

result for query "SELECT t1.id FROM test t1":
Array ( [id] => 1 )

result for query "SELECT t1.id FROM test t1 GROUP BY t1.id":
Array ( [t1.id] => 1 )

result for query "SELECT t1.id AS id FROM test t1 GROUP BY t1.id":
Array ( [id] => 1 ) 

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


#39361 [Com]: mbstring function overloading - done although not activated

2006-12-22 Thread christoph at ziegenberg dot de
 ID:   39361
 Comment by:   christoph at ziegenberg dot de
 Reported By:  s dot masugata at mbg dot nifty dot com
 Status:   Feedback
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 Assigned To:  masugata
 New Comment:

The example I posted works fine now (Win XP SP2).
Thanks!


Previous Comments:


[2006-12-21 18:02:47] [EMAIL PROTECTED]

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

Hi! :)

I'm fixed this problem(just now).
http://news.php.net/php.cvs/42277

Please, try snapshot.

[tested spript]:

 haystack):]-\n");
var_dump(strpos('1', '100' ) );
var_dump( mb_strpos('1', '100' ) );

print("\n--[strpos (offest > haystack):]-\n");
var_dump(strpos( '1', '1', 4 ) );
var_dump( mb_strpos( '1', '1', 4 ) );

print("\n--[stripos (empty haystack):]-\n");
var_dump(stripos( '', '' ) );
var_dump( mb_stripos( '', '' ) );

print("\n--[stripos (empty needle):]-\n");
var_dump(stripos( '1', '' ) );
var_dump( mb_stripos( '1', '' ) );

print("\n--[stripos (needle > haystack):]-\n");
var_dump(stripos('1', '100' ) );
var_dump( mb_stripos('1', '100' ) );

print("\n--[stripos (offest > haystack):]-\n");
var_dump(stripos( '1', '1', 4 ) );
var_dump( mb_stripos( '1', '1', 4 ) );

print("\n--[strrpos (empty haystack):]-\n");
var_dump(strrpos( '', '' ) );
var_dump( mb_strrpos( '', '' ) );

print("\n--[strrpos (empty needle):]-\n");
var_dump(strrpos( '1', '' ) );
var_dump( mb_strrpos( '1', '' ) );

print("\n--[strrpos (needle > haystack):]-\n");
var_dump(strrpos('1', '100' ) );
var_dump( mb_strrpos('1', '100' ) );

print("\n--[strrpos (offest > haystack):]-\n");
var_dump(strrpos( '1', '1', 4 ) );
var_dump( mb_strrpos( '1', '1', 4 ) );

print("\n--[strripos (empty haystack):]-\n");
var_dump(strripos( '', '' ) );
var_dump( mb_strripos( '', '' ) );

print("\n--[strripos (empty needle):]-\n");
var_dump(strripos( '1', '' ) );
var_dump( mb_strripos( '1', '' ) );

print("\n--[strripos (needle > haystack):]-\n");
var_dump(strripos('1', '100' ) );
var_dump( mb_strripos('1', '100' ) );

print("\n--[strripos (offest > haystack):]-\n");
var_dump(strripos( '1', '1', 4 ) );
var_dump( mb_strripos( '1', '1', 4 ) );

print("\n--[strstr (empty haystack):]-\n");
var_dump(strstr( '', '' ) );
var_dump( mb_strstr( '', '' ) );

print("\n--[strstr (empty needle):]-\n");
var_dump(strstr( '1', '' ) );
var_dump( mb_strstr( '1', '' ) );

print("\n--[strstr (needle > haystack):]-\n");
var_dump(strstr('1', '100' ) );
var_dump( mb_strstr('1', '100' ) );

print("\n--[stristr (empty haystack):]-\n");
var_dump(stristr( '', '' ) );
var_dump( mb_stristr( '', '' ) );

print("\n--[stristr (empty needle):]-\n");
var_dump(stristr( '1', '' ) );
var_dump( mb_stristr( '1', '' ) );

print("\n--[stristr (needle > haystack):]-\n");
var_dump(stristr('1', '100' ) );
var_dump( mb_stristr('1', '100' ) );

print("\n--[strrchr (empty haystack):]-\n");
var_dump(strrchr( '', '' ) );
var_dump( mb_strrchr( '', '' ) );

print("\n--[strrchr (empty needle):]-\n");
var_dump(strrchr( '1', '' ) );
var_dump( mb_strrchr( '1', '' ) );

print("\n--[substr_count (empty haystack):]-\n");
var_dump(substr_count( '', '' ) );
var_dump( mb_substr_count( '', '' ) );

print("\n--[substr_count (empty needle):]-\n"

#39361 [Opn]: mbstring function overloading - done although not activated

2006-12-09 Thread christoph at ziegenberg dot de
 ID:   39361
 User updated by:  christoph at ziegenberg dot de
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 New Comment:

You can download an example here:
http://www.ziegenberg.de/phpbug_39361.zip


Previous Comments:


[2006-12-09 16:12:34] [EMAIL PROTECTED]

There was no fix, the bug was accidentally closed. So far I've 
not been able to replicate the bug.



[2006-12-09 11:20:40] seanius at debian dot org

hi,

we've had a report about this in the debian bug tracking system:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399924

and possibly

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401525

the bug report says that it's been fixed in CVS, but then there's a
rather ambiguous "still  need to look into this" message afterwards and
the bug is still in state: assigned.

as debian will be freezing really, really soon if there's a fix for
this i'd really like to see it so i can backport it to the 5.2.0
packages that are going to ship with the next stable release.

thanks!



[2006-11-03 20:38:44] [EMAIL PROTECTED]

Still need to look into this one.



[2006-11-03 19:56:26] [EMAIL PROTECTED]

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.



--------

[2006-11-03 18:06:52] christoph at ziegenberg dot de

again the summary problem...



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

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


#39469 [NEW]: FILTER_VALIDATE_EMAIL does not accept IDN domain names

2006-11-11 Thread christoph at ziegenberg dot de
From: christoph at ziegenberg dot de
Operating system: WinXP SP2
PHP version:  5.2.0
PHP Bug Type: Filter related
Bug description:  FILTER_VALIDATE_EMAIL does not accept IDN domain names

Description:

The filter FILTER_VALIDATE_EMAIL does not accept IDN domain names, so
valid email addresses are not accepted, the punycode version works.

I know the check for this is a little bit complex, because the allowed
chars in the domain name depend on the TLD. 

I think the current behavior is okay as default, but there should be an
option to allow IDN domain names.

Reproduce code:
---


Expected result:

string(...) "..."
string(...) "..."

Actual result:
--
bool(false)
string(...) "..."

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


#39448 [Com]: Maximum execution time exceeded even if is unlimited

2006-11-10 Thread christoph at ziegenberg dot de
 ID:   39448
 Comment by:   christoph at ziegenberg dot de
 Reported By:  jschwabik at koop dot cz
 Status:   Feedback
 Bug Type: Performance problem
 Operating System: CentOS release 4.3
 PHP Version:  5.2.0
 New Comment:

Perhaps this has to do with the problem in Bug #39361, where ini
settings which are valid for a directory only are still active when
leaving the directory (although ini_get() returns the correct value).

I tested some settings and they worked, so I though this problem is a
mbstring problem - but it possibly occurs also with other ini
settings...


Previous Comments:


[2006-11-09 17:10:02] [EMAIL PROTECTED]

Not reproducible.



[2006-11-09 12:39:24] jschwabik at koop dot cz

Description:

I've got script running from linux shell and sometimes it crashes with
"Maximum execution time of 30 seconds exceeded in some line" error in
the script. 

The command on which it crashes is unpredictable. The script is runnig
sometimes 10 minutes, sometimes 30 minutes and crashes on different
lines. (It never runs 30 seconds).  

I am running it from command line (CLI) (max_execution_time should be
0) an I set it with set_time_limit(0) to 0.

I've tried two servers 4 php versions (4.4.2, 4.4.4,5.1.6,5.2.0)

In my php.ini is max_execution_time set to 0.

Sometimes it ends on ifx_fetch_row().
Sometimes it ends on mktime().

My configure
'./configure' '--with-config-file-path=/etc/php.ini'
'--with-apache=../apache_1.3.37/' '--with-informix=/opt/informix'
'--with-mysql=/usr/local/mysql/' '--enable-ftp' '--with-gd'
'--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-zlib'
'--with-jpeg-dir=/usr/' '--with-freetype-dir=/usr' '--with-dom=./ext'
'--with-ldap' '--with-mssql=/usr/local/' '--enable-dbase'
'--with-iconv=/usr/local' 


PHP Core Info
.
.
.
max_execution_time => 0 => 30
max_input_time => -1 => 60
open_basedir => no value => no value
output_buffering => 0 => no value
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 12 => 12
safe_mode => Off => Off
.
.
.

Reproduce code:
---





Expected result:

"End" is echoed or some meaningful error message. 

Actual result:
--
Fatal error:Maximum execution time of 30 seconds exceeded in ...





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


#39400 [Opn]: More differences beetween functions and the mbstring versions

2006-11-06 Thread christoph at ziegenberg dot de
 ID:   39400
 User updated by:  christoph at ziegenberg dot de
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP
 PHP Version:  5.2.0
 New Comment:

Point "different behaviour between a function and the case-insensitive
version" isn't right, I meant the difference between stripos() and
strripos() (which behave equal in the mbstring version).


Previous Comments:


[2006-11-06 13:21:54] christoph at ziegenberg dot de

Description:

I posted a bug for the wrong behaviour of mb_strstr() compared to
strstr() before - this has been fixed, but also the other functions
behave different.

Here a code to see more differences: 

- different behaviours between functions and the mbstring versions,
- different error messages and 
- different behaviour between a function and the case-insensitive
version

Reproduce code:
---
');
stripos('', ',', 0);
mb_stripos('', ',', 0);

print('stripos (offest > length):');
stripos('1', ',', 3);
mb_stripos('1', ',', 3);

print('strripos (empty haystack):');

strripos('', ',', 0);
mb_strripos('', ',', 0);

print('strripos (offest > length):');
strripos('1', ',', 3);
mb_strripos('1', ',', 3);

print('stristr (empty haystack):');
stristr('', ',');
mb_stristr('', ',');

print('strrichr (empty haystack):');
strrchr('', ',');
mb_strrchr('', ',');
?>

Expected result:

stripos (empty haystack):

stripos (offest > length):

[same error message, dunno which is the better one - they mean the
same, but it would be better to get the same text. or no error as in
strripos(), see below.]

strripos (empty haystack):

strripos (offest > length):

[same as for stripos() - strripos() returns no error here]

stristr (empty haystack):

strrichr (empty haystack):

Actual result:
--
stripos (empty haystack):

Warning: mb_stripos() [function.mb-stripos]: Empty haystack in
W:\www\mb_functions.php on line 4

stripos (offest > length):

Warning: stripos() [function.stripos]: Offset not contained in string.
in W:\www\mb_functions.php on line 7

Warning: mb_stripos() [function.mb-stripos]: Offset is out of range in
W:\www\mb_functions.php on line 8

strripos (empty haystack):

Warning: mb_strripos() [function.mb-strripos]: Empty haystack in
W:\www\mb_functions.php on line 13

strripos (offest > length):

Warning: mb_strripos() [function.mb-strripos]: Offset is out of range
in W:\www\mb_functions.php on line 17

stristr (empty haystack):

Warning: mb_stristr() [function.mb-stristr]: Empty haystack in
W:\www\mb_functions.php on line 21

strrichr (empty haystack):

Warning: mb_strrchr() [function.mb-strrchr]: Empty haystack in
W:\www\mb_functions.php on line 25





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


#39400 [NEW]: More differences beetween functions and the mbstring versions

2006-11-06 Thread christoph at ziegenberg dot de
From: christoph at ziegenberg dot de
Operating system: Win XP
PHP version:  5.2.0
PHP Bug Type: mbstring related
Bug description:  More differences beetween functions and the mbstring versions

Description:

I posted a bug for the wrong behaviour of mb_strstr() compared to strstr()
before - this has been fixed, but also the other functions behave
different.

Here a code to see more differences: 

- different behaviours between functions and the mbstring versions,
- different error messages and 
- different behaviour between a function and the case-insensitive version

Reproduce code:
---
');
stripos('', ',', 0);
mb_stripos('', ',', 0);

print('stripos (offest > length):');
stripos('1', ',', 3);
mb_stripos('1', ',', 3);

print('strripos (empty haystack):');

strripos('', ',', 0);
mb_strripos('', ',', 0);

print('strripos (offest > length):');
strripos('1', ',', 3);
mb_strripos('1', ',', 3);

print('stristr (empty haystack):');
stristr('', ',');
mb_stristr('', ',');

print('strrichr (empty haystack):');
strrchr('', ',');
mb_strrchr('', ',');
?>

Expected result:

stripos (empty haystack):

stripos (offest > length):

[same error message, dunno which is the better one - they mean the same,
but it would be better to get the same text. or no error as in strripos(),
see below.]

strripos (empty haystack):

strripos (offest > length):

[same as for stripos() - strripos() returns no error here]

stristr (empty haystack):

strrichr (empty haystack):

Actual result:
--
stripos (empty haystack):

Warning: mb_stripos() [function.mb-stripos]: Empty haystack in
W:\www\mb_functions.php on line 4

stripos (offest > length):

Warning: stripos() [function.stripos]: Offset not contained in string. in
W:\www\mb_functions.php on line 7

Warning: mb_stripos() [function.mb-stripos]: Offset is out of range in
W:\www\mb_functions.php on line 8

strripos (empty haystack):

Warning: mb_strripos() [function.mb-strripos]: Empty haystack in
W:\www\mb_functions.php on line 13

strripos (offest > length):

Warning: mb_strripos() [function.mb-strripos]: Offset is out of range in
W:\www\mb_functions.php on line 17

stristr (empty haystack):

Warning: mb_stristr() [function.mb-stristr]: Empty haystack in
W:\www\mb_functions.php on line 21

strrichr (empty haystack):

Warning: mb_strrchr() [function.mb-strrchr]: Empty haystack in
W:\www\mb_functions.php on line 25

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


#39364 [Bgs->Opn]: mb_strstr() behavior differs from strstr()

2006-11-03 Thread christoph at ziegenberg dot de
 ID:   39364
 User updated by:  christoph at ziegenberg dot de
-Summary:  mb_strstr() behaviour differs from strstr()
 Reported By:  christoph at ziegenberg dot de
-Status:   Bogus
+Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 New Comment:

No, that is not the same bug!

Bug #39361 is about that the ini settings for function overloading are
"cached" and still active when changing the directory.

Bug #39364 is about the different behavior of mb_strstr() and
strstr().

I found bug number one when checking the second one, but that not the
same bug... so which one did you fix?


Previous Comments:


[2006-11-03 19:56:40] [EMAIL PROTECTED]

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

dupe of 39361



[2006-11-03 17:38:23] christoph at ziegenberg dot de

Description:

as described in the more important bug #39361 i compared strstr() and
mb_strstr().

mb_strstr() produces the following error when using an empty haystack:

Warning: mb_strstr() [function.mb-strstr]: 
Empty haystack in X on line Y

but strstr() doesn't.

Reproduce code:
---


Expected result:

no error message - because haystack does not contain needle, so the
function should return false, as described in the documentation. the
different behavior produces a lot of errors when using function
overloading (although i know using it is not a good idea... ;).

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in X on line
Y





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


#39361 [Opn]: mbstring function overloading - done although not activated

2006-11-03 Thread christoph at ziegenberg dot de
 ID:   39361
 User updated by:  christoph at ziegenberg dot de
-Summary:  more info...
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 New Comment:

again the summary problem...


Previous Comments:


[2006-11-03 18:06:06] christoph at ziegenberg dot de

The value returned by ini_get() is correct (also the phpinfo() output),
but the behavior is wrong... I tested several other ini settings, but
the error seems to occur only with the mbstring function overloading.



[2006-11-03 17:28:47] christoph at ziegenberg dot de

Oh... I got the reason for it... really bad bug, might be critical and
influence other ini setting to:

1) run the script - it works. you get the error message for mb_strstr()
only:
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

2) run a script in another directory with mbstring function overloading
activate* - the result is as expected:
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

3) now run the first script (NOT in the created directory!) and you get
the same error messages!
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4


So the overloading setting is activated for the wrong directory!


* via .htaccess:
php_value mbstring.func_overload 6



[2006-11-03 14:55:55] christoph at ziegenberg dot de

wrong summary



[2006-11-03 14:54:41] christoph at ziegenberg dot de

Description:

I got a new error message in PHP 5.2 when using mb_strstr() with an
empty string as haystack. So I wrote a testfile to compare the
behaviour of strstr() with mb_strstr().

Although mbstring function overloading is not enabled and the phpinfo()
output (in the same file, so there are no more changes via .htaccess)
says that all mbstring settings are the default settings, strstr() is
overloaded with mb_strstr(). 

phpinfo output:
---
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value
---


Reproduce code:
---


Expected result:

Warning: strstr() [function.strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4





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


#39361 [Opn]: more info...

2006-11-03 Thread christoph at ziegenberg dot de
 ID:   39361
 User updated by:  christoph at ziegenberg dot de
-Summary:  mbstring function overloading - done although not
   activated
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 New Comment:

The value returned by ini_get() is correct (also the phpinfo() output),
but the behavior is wrong... I tested several other ini settings, but
the error seems to occur only with the mbstring function overloading.


Previous Comments:


[2006-11-03 17:28:47] christoph at ziegenberg dot de

Oh... I got the reason for it... really bad bug, might be critical and
influence other ini setting to:

1) run the script - it works. you get the error message for mb_strstr()
only:
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

2) run a script in another directory with mbstring function overloading
activate* - the result is as expected:
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

3) now run the first script (NOT in the created directory!) and you get
the same error messages!
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4


So the overloading setting is activated for the wrong directory!


* via .htaccess:
php_value mbstring.func_overload 6



[2006-11-03 14:55:55] christoph at ziegenberg dot de

wrong summary



[2006-11-03 14:54:41] christoph at ziegenberg dot de

Description:

I got a new error message in PHP 5.2 when using mb_strstr() with an
empty string as haystack. So I wrote a testfile to compare the
behaviour of strstr() with mb_strstr().

Although mbstring function overloading is not enabled and the phpinfo()
output (in the same file, so there are no more changes via .htaccess)
says that all mbstring settings are the default settings, strstr() is
overloaded with mb_strstr(). 

phpinfo output:
---
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value
---


Reproduce code:
---


Expected result:

Warning: strstr() [function.strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4





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


#39364 [NEW]: mb_strstr() behaviour differs from strstr()

2006-11-03 Thread christoph at ziegenberg dot de
From: christoph at ziegenberg dot de
Operating system: Win XP SP 2
PHP version:  5.2.0
PHP Bug Type: mbstring related
Bug description:  mb_strstr() behaviour differs from strstr()

Description:

as described in the more important bug #39361 i compared strstr() and
mb_strstr().

mb_strstr() produces the following error when using an empty haystack:

Warning: mb_strstr() [function.mb-strstr]: 
Empty haystack in X on line Y

but strstr() doesn't.

Reproduce code:
---


Expected result:

no error message - because haystack does not contain needle, so the
function should return false, as described in the documentation. the
different behavior produces a lot of errors when using function
overloading (although i know using it is not a good idea... ;).

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in X on line Y

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


#39361 [Opn]: mbstring function overloading - done although not activated

2006-11-03 Thread christoph at ziegenberg dot de
 ID:   39361
 User updated by:  christoph at ziegenberg dot de
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 New Comment:

Oh... I got the reason for it... really bad bug, might be critical and
influence other ini setting to:

1) run the script - it works. you get the error message for mb_strstr()
only:
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

2) run a script in another directory with mbstring function overloading
activate* - the result is as expected:
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

3) now run the first script (NOT in the created directory!) and you get
the same error messages!
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4


So the overloading setting is activated for the wrong directory!


* via .htaccess:
php_value mbstring.func_overload 6


Previous Comments:


[2006-11-03 14:55:55] christoph at ziegenberg dot de

wrong summary



[2006-11-03 14:54:41] christoph at ziegenberg dot de

Description:

I got a new error message in PHP 5.2 when using mb_strstr() with an
empty string as haystack. So I wrote a testfile to compare the
behaviour of strstr() with mb_strstr().

Although mbstring function overloading is not enabled and the phpinfo()
output (in the same file, so there are no more changes via .htaccess)
says that all mbstring settings are the default settings, strstr() is
overloaded with mb_strstr(). 

phpinfo output:
---
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value
---


Reproduce code:
---


Expected result:

Warning: strstr() [function.strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4





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


#39361 [Opn]: mbstring function overloading - done although not activated

2006-11-03 Thread christoph at ziegenberg dot de
 ID:   39361
 User updated by:  christoph at ziegenberg dot de
-Summary:  mbstring function overloading - local value ignored
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: mbstring related
 Operating System: Win XP SP 2
 PHP Version:  5.2.0
 New Comment:

wrong summary


Previous Comments:


[2006-11-03 14:54:41] christoph at ziegenberg dot de

Description:

I got a new error message in PHP 5.2 when using mb_strstr() with an
empty string as haystack. So I wrote a testfile to compare the
behaviour of strstr() with mb_strstr().

Although mbstring function overloading is not enabled and the phpinfo()
output (in the same file, so there are no more changes via .htaccess)
says that all mbstring settings are the default settings, strstr() is
overloaded with mb_strstr(). 

phpinfo output:
---
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value
---


Reproduce code:
---


Expected result:

Warning: strstr() [function.strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4





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


#39361 [NEW]: mbstring function overloading - local value ignored

2006-11-03 Thread christoph at ziegenberg dot de
From: christoph at ziegenberg dot de
Operating system: Win XP SP 2
PHP version:  5.2.0
PHP Bug Type: mbstring related
Bug description:  mbstring function overloading - local value ignored

Description:

I got a new error message in PHP 5.2 when using mb_strstr() with an empty
string as haystack. So I wrote a testfile to compare the behaviour of
strstr() with mb_strstr().

Although mbstring function overloading is not enabled and the phpinfo()
output (in the same file, so there are no more changes via .htaccess) says
that all mbstring settings are the default settings, strstr() is overloaded
with mb_strstr(). 

phpinfo output:
---
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value
---


Reproduce code:
---


Expected result:

Warning: strstr() [function.strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

Actual result:
--
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 3

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in
W:\www\strstr\strstr.php on line 4

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


#39003 [Opn]: __autoload unnecessarily called for type hinting

2006-09-30 Thread christoph at ziegenberg dot de
 ID:   39003
 User updated by:  christoph at ziegenberg dot de
 Reported By:  christoph at ziegenberg dot de
 Status:   Open
 Bug Type: Performance problem
 Operating System: WinXP SP2
 PHP Version:  5.1.6
 New Comment:

My version of the manual says this (from the example code):

// Fatal Error: Argument 1 must be an instance of OtherClass
$foo = new stdClass;
$myclass->test($foo);

So I should get the error "Fatal error: Argument 1 passed to test()
must be an instance of OtherClassName, called in [...]", but I get the
error "Fatal error: Class 'OtherClassName' not found in [...]".

Of course these are both fatal errors, but the one hand I expect
another behaviour for the autoloader function as described and on the
other hand the "correct" error message would help to debug the code,
because the current error only refers to the __autoloader() function
(so you have to use debug_backtrace()/debug_print_backtrace()).


Previous Comments:


[2006-10-01 06:07:57] judas dot iscariote at gmail dot com

if this is the expected behaviuor ( at least, not the behaviuor I
expect ;) ) it is not mentioned in the manual, so either the manual or
the engine needs to be corrected ;-)

--------

[2006-09-30 10:05:56] christoph at ziegenberg dot de

Description:

if i check if a variable is an instance of specific class with
"instanceof" and the class i check for has not been loaded,
__autoloader() is not called (as expected).

if i do the "same" check by type hinting, the __autoloader() function
is called, which normally leads to including the required class file
and so unnecessarily consumes memory and time.

Reproduce code:
---
";
}
test($obj);
?>

Expected result:

no instance of OtherClassName

Actual result:
--
no instance of OtherClassName
try to load class OtherClassName
Fatal error: Class 'OtherClassName' not found in [...] on line 7





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


#39003 [NEW]: __autoload unnecessarily called for type hinting

2006-09-30 Thread christoph at ziegenberg dot de
From: christoph at ziegenberg dot de
Operating system: WinXP SP2
PHP version:  5.1.6
PHP Bug Type: Performance problem
Bug description:  __autoload unnecessarily called for type hinting

Description:

if i check if a variable is an instance of specific class with
"instanceof" and the class i check for has not been loaded, __autoloader()
is not called (as expected).

if i do the "same" check by type hinting, the __autoloader() function is
called, which normally leads to including the required class file and so
unnecessarily consumes memory and time.

Reproduce code:
---
";
}
test($obj);
?>

Expected result:

no instance of OtherClassName

Actual result:
--
no instance of OtherClassName
try to load class OtherClassName
Fatal error: Class 'OtherClassName' not found in [...] on line 7

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