[PHP-BUG] Bug #52539 [NEW]: Calling function from rebound Closure causes crash

2010-08-05 Thread cataphr...@php.net
From: cataphract
Operating system: Windows
PHP version:  trunk-SVN-2010-08-05 (SVN)
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Calling function from rebound Closure causes crash

Description:

Calling a function in a rebound closure causes a crash.



This seems to be caused by dmitry's optimizations because this fixes the
issue:

#define CACHED_PTR(num) 0.

Test script:
---
class foo {

static function getClosure() {

return static function () {

//causes a crash (fbc not properly defined) in call 
after rebinding

echo get_called_class(), "\n";

};

}

}

 

class subFoo { }

 

$c = foo::getClosure();

$c(); //foo

$c = $c->bindTo(new subFoo());

$c(); //crash

Expected result:

No crash.

Actual result:
--
>   php5ts_debug.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data=0x025d2298, void * * * tsrm_ls=0x02784bf8)  Line 302 + 0x3
bytes   C

php5ts_debug.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data *
execute_data=0x025d2298, void * * * tsrm_ls=0x02784bf8)  Line 1721  C

php5ts_debug.dll!execute(_zend_op_array * op_array=0x025f23c8, void * * 
*
tsrm_ls=0x02784bf8)  Line 136 + 0x11 bytes  C

php5ts_debug.dll!zend_execute_scripts(int type=8, void * * *
tsrm_ls=0x02784bf8, _zval_struct * * retval=0x, int file_count=3,
...)  Line 1193 + 0x21 bytesC

php5ts_debug.dll!php_execute_script(_zend_file_handle *
primary_file=0x00aaf7b0, void * * * tsrm_ls=0x02784bf8)  Line 2330 + 0x1b
bytes   C

php.exe!main(int argc=2, char * * argv=0x02784af8)  Line 1252 + 0x13
bytes   C



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



[PHP-BUG] Bug #52540 [NEW]: Error on update array's field through __set magic method

2010-08-05 Thread trong at ngs dot ru
From: 
Operating system: Windows XP
PHP version:  5.3.3
Package:  Class/Object related
Bug Type: Bug
Bug description:Error on update array's field through __set magic method

Description:

If I use __set magic method for arrays and try to update some field of
array I see 

the old value. But, if I use the same scheme for ArrayObject I'll get the
right 

result.

Test script:
---
data[$name];

}



public function __set($name, $value) {

$this->data[$name] = $value;

}

}



// define test array

$array = array( 'view' => array('x' => 1, 'y' => 1) );



$t = new t();

$t->mas = $array;



// update field of array

$t->mas['view']['x'] = ;

echo $t->mas['view']['x'];



echo '';



$t->mas2 = new ArrayObject($array);

$t->mas2['view']['x'] = ;

echo $t->mas2['view']['x'];



?>

Expected result:







Actual result:
--
1





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



[PHP-BUG] Bug #52541 [NEW]: 10 == '10px' => true !

2010-08-05 Thread developer dot mahmoud at gmail dot com
From: 
Operating system: win 7
PHP version:  5.3SVN-2010-08-05 (SVN)
Package:  Variables related
Bug Type: Bug
Bug description:10 == '10px' => true !

Description:

when i compare between number and string it compare only the number in the
string



Test script:
---
$id = 10;



if($id == '10px')

   echo 'yes'; // it say yes ! 

Expected result:

it say yes !

but 10 != '10px'


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



Bug #52541 [Opn->Bgs]: 10 == '10px' => true !

2010-08-05 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=52541&edit=1

 ID: 52541
 Updated by: ras...@php.net
 Reported by:developer dot mahmoud at gmail dot com
 Summary:10 == '10px' => true !
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Variables related
 Operating System:   win 7
 PHP Version:5.3SVN-2010-08-05 (SVN)
 Block user comment: N

 New Comment:

Use === if you want a strict comparison.  Otherwise since you are
comparing an int 

to a string, it will compare the integer value of the string, which is
10 to 10 

and it will match.


Previous Comments:

[2010-08-05 10:12:18] developer dot mahmoud at gmail dot com

Description:

when i compare between number and string it compare only the number in
the string



Test script:
---
$id = 10;



if($id == '10px')

   echo 'yes'; // it say yes ! 

Expected result:

it say yes !

but 10 != '10px'







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


Bug #52540 [Opn->Bgs]: Error on update array's field through __set magic method

2010-08-05 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52540&edit=1

 ID: 52540
 Updated by: johan...@php.net
 Reported by:trong at ngs dot ru
 Summary:Error on update array's field through __set magic
 method
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Class/Object related
 Operating System:   Windows XP
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

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

When using the array as storage the __get() method will return a copy of
the array. When using ArrayObject it will return a handle to the object.
So with an array you're working on a copy, with objects on the same
object.



For objet handles check
http://www.php.net/manual/en/language.oop5.references.php


Previous Comments:

[2010-08-05 09:43:33] trong at ngs dot ru

Description:

If I use __set magic method for arrays and try to update some field of
array I see 

the old value. But, if I use the same scheme for ArrayObject I'll get
the right 

result.

Test script:
---
data[$name];

}



public function __set($name, $value) {

$this->data[$name] = $value;

}

}



// define test array

$array = array( 'view' => array('x' => 1, 'y' => 1) );



$t = new t();

$t->mas = $array;



// update field of array

$t->mas['view']['x'] = ;

echo $t->mas['view']['x'];



echo '';



$t->mas2 = new ArrayObject($array);

$t->mas2['view']['x'] = ;

echo $t->mas2['view']['x'];



?>

Expected result:







Actual result:
--
1










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


Bug #52541 [Bgs]: 10 == '10px' => true !

2010-08-05 Thread developer dot mahmoud at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52541&edit=1

 ID: 52541
 User updated by:developer dot mahmoud at gmail dot com
 Reported by:developer dot mahmoud at gmail dot com
 Summary:10 == '10px' => true !
 Status: Bogus
 Type:   Bug
 Package:Variables related
 Operating System:   win 7
 PHP Version:5.3SVN-2010-08-05 (SVN)
 Block user comment: N

 New Comment:

i understand now

thanks


Previous Comments:

[2010-08-05 10:16:09] ras...@php.net

Use === if you want a strict comparison.  Otherwise since you are
comparing an int 

to a string, it will compare the integer value of the string, which is
10 to 10 

and it will match.


[2010-08-05 10:12:18] developer dot mahmoud at gmail dot com

Description:

when i compare between number and string it compare only the number in
the string



Test script:
---
$id = 10;



if($id == '10px')

   echo 'yes'; // it say yes ! 

Expected result:

it say yes !

but 10 != '10px'







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


[PHP-BUG] Bug #52542 [NEW]: Alternative PHP Cache Bug /mv cmd

2010-08-05 Thread asimbaki at gmail dot com
From: 
Operating system: linux
PHP version:  5.2.14
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:Alternative PHP Cache Bug /mv cmd

Description:

# I have the following directories structure

# document root: /home/mysite/web

# lib directory /home/mysite/lib/vendor/



# I have the following line of code in 'index.php' to include the
'mytest.class.php'. It works well in browser, lynx and on CLI.



require_once(dirname(__FILE__)."/../lib/vendor/mytest.class.php");



# index.php in web directory

# mytest.class.php is in lib/vendor directory



# I performed the following linux commands:

# $ mkdir -p /home/mysite/libtest

# $ mv /home/mysite/lib/* /home/mysite/libtest



# Then I changed the above php code (index.php) as follows:

require_once(dirname(__FILE__)."/../libtest/vendor/mytest.class.php");



# When I run the script from browser, it shows error that fail to find the
file 'mytest.class.php' in /home/mysite/vendor. I cleared the cache, used
other fresh browser, but same results, lynx showing the same results, CLI
works though



# I am using APC

# os: Linux www.wackylab.com 2.6.18-028stab059.6 #1 SMP Fri Nov 14 14:01:22
MSK 2008 i686 i686 i386 GNU/Linux





Test script:
---
# change this line of code in index.php

require_once(dirname(__FILE__)."/../lib/vendor/mytest.class.php");

echo "This is a test";



# to:

require_once(dirname(__FILE__)."/../libtest/vendor/mytest.class.php");

echo "This is a test";

Expected result:

This is a test

Actual result:
--
failed to open stream: No such file or directory in /home/mysite/

This is a test

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



Bug #52302 [Asn]: mysqli_fetch_all does not work with MYSQLI_USE_RESULT

2010-08-05 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52302&edit=1

 ID: 52302
 Updated by: johan...@php.net
 Reported by:brianlm...@php.net
 Summary:mysqli_fetch_all does not work with
 MYSQLI_USE_RESULT
 Status: Assigned
 Type:   Bug
 Package:MySQLi related
 Operating System:   Linux
 PHP Version:5.3.2
 Assigned To:mysql
 Block user comment: N

 New Comment:

The key point here is that the stored buffer can directly be used for
fetch_all. The fetch_all does nothing but increasing the ref counts on
the buffered values and adding them to an array. doing this with
USE_RESULT would do an implicit STORE_RESULT.



Marking this a Feature request.


Previous Comments:

[2010-07-16 17:42:59] brianlm...@php.net

No, it makes perfect sense. In fact, it should be the preferred way to
use fetch_all. Why store the data only to dump it into a PHP array on
the next line? That is a very inefficient use of memory and plain
careless development.



Or do you mean to say that fetch_all is fundamentally broken and will
only work with STORE_RESULT?


[2010-07-13 10:36:22] and...@php.net

Makes no sense to use USE_RESULT and buffer the result. Use
STORE_RESULT, it is more effective for fetch_all(). Artifically limited.


[2010-07-12 18:16:35] brad at njoe dot com

Confirmed on Windows build as well using: PHP 5.3.2 (cli) (built: Mar  3
2010 

19:40:13).



Even SELECT'ing a static string (e.g. SELECT 'This is a test.') exhibits
this 

behavior.


[2010-07-10 10:39:32] brianlm...@php.net

Description:

When using MYSQLI_USE_RESULT as the second parameter to mysqli_query,
fetch_all returns null.

Test script:
---
query($sql, MYSQLI_USE_RESULT);



$rows = $res->fetch_all();



var_dump($rows);



?>

Expected result:

An array of the table data.

Actual result:
--
NULL






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


Bug #52542 [Com]: Alternative PHP Cache Bug /mv cmd

2010-08-05 Thread asimbaki at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52542&edit=1

 ID: 52542
 Comment by: asimbaki at gmail dot com
 Reported by:asimbaki at gmail dot com
 Summary:Alternative PHP Cache Bug /mv cmd
 Status: Open
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   linux
 PHP Version:5.2.14
 Block user comment: N

 New Comment:

Even, if the path is hard-coded the same results. Also, the path in the
error message was unexpected. The problem is not with dirname. Might be
some file stat problem.


Previous Comments:

[2010-08-05 14:07:52] asimbaki at gmail dot com

Description:

# I have the following directories structure

# document root: /home/mysite/web

# lib directory /home/mysite/lib/vendor/



# I have the following line of code in 'index.php' to include the
'mytest.class.php'. It works well in browser, lynx and on CLI.



require_once(dirname(__FILE__)."/../lib/vendor/mytest.class.php");



# index.php in web directory

# mytest.class.php is in lib/vendor directory



# I performed the following linux commands:

# $ mkdir -p /home/mysite/libtest

# $ mv /home/mysite/lib/* /home/mysite/libtest



# Then I changed the above php code (index.php) as follows:

require_once(dirname(__FILE__)."/../libtest/vendor/mytest.class.php");



# When I run the script from browser, it shows error that fail to find
the file 'mytest.class.php' in /home/mysite/vendor. I cleared the cache,
used other fresh browser, but same results, lynx showing the same
results, CLI works though



# I am using APC

# os: Linux www.wackylab.com 2.6.18-028stab059.6 #1 SMP Fri Nov 14
14:01:22 MSK 2008 i686 i686 i386 GNU/Linux





Test script:
---
# change this line of code in index.php

require_once(dirname(__FILE__)."/../lib/vendor/mytest.class.php");

echo "This is a test";



# to:

require_once(dirname(__FILE__)."/../libtest/vendor/mytest.class.php");

echo "This is a test";

Expected result:

This is a test

Actual result:
--
failed to open stream: No such file or directory in
/home/mysite/

This is a test






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


Bug #45921 [Asn->Fbk]: Can't initialize character set hebrew (path: C:\mysql\\share\charsets\)

2010-08-05 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=45921&edit=1

 ID: 45921
 Updated by: johan...@php.net
 Reported by:ymagriso at gmail dot com
 Summary:Can't initialize character set hebrew (path:
 C:\mysql\\share\charsets\)
-Status: Assigned
+Status: Feedback
 Type:   Bug
 Package:MySQLi related
 Operating System:   win32 only
 PHP Version:5.2.6
 Assigned To:mysql
 Block user comment: N

 New Comment:

Please mind the last comments and test a more recent snapshot/release.


Previous Comments:

[2009-04-27 11:54:05] johan...@php.net

Sorry, my bad, confused names,  SET_CHARSET_DIR is the one i meant, but
that isn't exported, checking whether there's a reason or just 
oversight.


[2009-04-27 11:25:58] johan...@php.net

Please use $db->options(MYSQLI_SET_CHARSET_NAME,
'C:\\MySQL5.0\\share\\charsets'); to properly set the charset path.


[2008-11-21 19:21:07] paj...@php.net

All mysql extensions use the same library. Assigned back to "mysql" and
let them try to figure what's wrong here.


[2008-09-01 20:28:34] ymagriso at gmail dot com

I found a solution to the problem.

The problem is related to php_mysqli.dll that comes with the PHP
installer package.



I downloaded another version of the DLL from MySQL website:

http://dev.mysql.com/get/Downloads/Connector-PHP-mysqlnd/php_5.2.1-mysqlnd-5.0.1-beta.zip/from/pick



I replaced the "faulty" DLL (that came with the PHP installer package)
with the one I downloaded from MySQL website, then restarted the
webserver and the problem was gone.



I would recommend to check the php_mysqli.dll that comes with the PHP
installer package.


[2008-08-31 12:54:58] ymagriso at gmail dot com

I just wanted to add another comment.



I called the following queries via PHP using MySQLi:

1) show character set

2) show variables like "%character%"



Surprisingly, I got exactly the same results as via "mysql" client.

So, the problem seems to be related to the mysqli::set_charset(). I
could not find anywhere in "php.ini" or "my.ini" (MySQL) that path
defined ("C:\mysql\\share\charsets\").



My guess is that the path "C:\mysql\\share\charsets\" is hardcoded
within the method in the MySQLi library (php_mysqli.dll).




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/bug.php?id=45921


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


Bug #52542 [Opn->Bgs]: Alternative PHP Cache Bug /mv cmd

2010-08-05 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52542&edit=1

 ID: 52542
 Updated by: johan...@php.net
 Reported by:asimbaki at gmail dot com
 Summary:Alternative PHP Cache Bug /mv cmd
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   linux
 PHP Version:5.2.14
 Block user comment: N

 New Comment:

Please report APC bugs on http://pecl.php.net/apc



While what oyu are seeing might be, depending on your APC configuration,
expected as APC works on the inodes and tries to reduce the amount of
file system lookups ...


Previous Comments:

[2010-08-05 14:26:18] asimbaki at gmail dot com

Even, if the path is hard-coded the same results. Also, the path in the
error message was unexpected. The problem is not with dirname. Might be
some file stat problem.


[2010-08-05 14:07:52] asimbaki at gmail dot com

Description:

# I have the following directories structure

# document root: /home/mysite/web

# lib directory /home/mysite/lib/vendor/



# I have the following line of code in 'index.php' to include the
'mytest.class.php'. It works well in browser, lynx and on CLI.



require_once(dirname(__FILE__)."/../lib/vendor/mytest.class.php");



# index.php in web directory

# mytest.class.php is in lib/vendor directory



# I performed the following linux commands:

# $ mkdir -p /home/mysite/libtest

# $ mv /home/mysite/lib/* /home/mysite/libtest



# Then I changed the above php code (index.php) as follows:

require_once(dirname(__FILE__)."/../libtest/vendor/mytest.class.php");



# When I run the script from browser, it shows error that fail to find
the file 'mytest.class.php' in /home/mysite/vendor. I cleared the cache,
used other fresh browser, but same results, lynx showing the same
results, CLI works though



# I am using APC

# os: Linux www.wackylab.com 2.6.18-028stab059.6 #1 SMP Fri Nov 14
14:01:22 MSK 2008 i686 i686 i386 GNU/Linux





Test script:
---
# change this line of code in index.php

require_once(dirname(__FILE__)."/../lib/vendor/mytest.class.php");

echo "This is a test";



# to:

require_once(dirname(__FILE__)."/../libtest/vendor/mytest.class.php");

echo "This is a test";

Expected result:

This is a test

Actual result:
--
failed to open stream: No such file or directory in
/home/mysite/

This is a test






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


Bug #52521 [Fbk->Opn]: self-referenced array is copied instead of referenced after serialization

2010-08-05 Thread martin dot leucht at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52521&edit=1

 ID: 52521
 User updated by:martin dot leucht at gmail dot com
 Reported by:martin dot leucht at gmail dot com
-Summary:serialize() loses reference to root
+Summary:self-referenced array is copied instead of
 referenced after serialization
-Status: Feedback
+Status: Open
 Type:   Bug
-Package:*Programming Data Structures
+Package:Arrays related
 Operating System:   WIN32
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

// updated bug information


Previous Comments:

[2010-08-04 22:50:22] martin dot leucht at googlemail dot com

It seems it is array-related. The same thing using the stdclass works
fine.



Test script:



 1,

'b' => &$Object,

);

print_r($Object);



$Array = array(

'a' => 1,

'b' => &$Array,

);

print_r($Array);



$Array = unserialize(serialize($Array));

$Object = unserialize(serialize($Object));



$Object->b->a = 2;

print_r($Object);



$Array['b']['a'] = 2;

print_r($Array);



?>



Actual result:

--

stdClass Object

(

[a] => 1

[b] => stdClass Object

 *RECURSION*

)

Array

(

[a] => 1

[b] => Array

(

[a] => 1

[b] => Array

 *RECURSION*

)



)

stdClass Object

(

[a] => 2

[b] => stdClass Object

 *RECURSION*

)

Array

(

[a] => 1

[b] => Array

(

[a] => 2

[b] => Array

 *RECURSION*

)



)


[2010-08-04 22:03:08] martin dot leucht at googlemail dot com

Okay, I finally made it though. I setup a build environment, built the
latest dev-version of PHP and ran the test script. But still: identical
results.



Please tell me how can I provide some help or assistence to solve this
issue?!


[2010-08-03 13:23:39] martin dot leucht at gmail dot com

Sorry, but there are no builds on the Windows snapshots page and as I do
not maintain a PHP build environment (nor am currently willing to do so
due to a lack of time) I can not test it right now.

Could you please give me a hint when the snapshot builds are available
or if anyone else can do this test using the given test script above.


[2010-08-03 09:53:39] m...@php.net

Please try using this snapshot:

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

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

Could you please try a trunk snapshot, IIRC this problem might be fixed
already.



Thanks.


[2010-08-03 09:27:20] martin dot leucht at gmail dot com

I have to correct myself:



> If I unserialize the "correct" serialized string, it works correctly.

It just works for print_r() afterwards, but if I do some stuff on the
referenced value it creates even more confusing structures.



Test script:



echo "*** using correct value ***\n\n";



$Array = unserialize('a:2:{s:1:"a";i:1;s:1:"b";R:1;}');

echo "print_r():\n";

echo "--\n";

print_r($Array);

echo "\n";



$Array['b']['a'] = 2;

echo "print_r():\n";

echo "--\n";

print_r($Array);

echo "\n";



Actual result

-

*** using correct value ***



print_r():

--

Array

(

[a] => 1

[b] => Array

 *RECURSION*

)



print_r():

--

Array

(

[a] => 1

[b] => Array

(

[a] => 2

[b] => Array

(

[a] => 1

[b] => Array

 *RECURSION*

)



)



)



Expected result

---

*** using correct value ***



print_r():

--

Array

(

[a] => 1

[b] => Array

 *RECURSION*

)



print_r():

--

Array

(

[a] => 2

[b] => Array

 *RECURSION*

)




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/bug.php?id=52521


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


Req #49576 [Com]: Filter var for validating email is not validating emails correctly

2010-08-05 Thread alexsander dot rosa at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=49576&edit=1

 ID: 49576
 Comment by: alexsander dot rosa at gmail dot com
 Reported by:mparkin at de-facto dot com
 Summary:Filter var for validating email is not validating
 emails correctly
 Status: Closed
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   *
 PHP Version:5.*, 6
 Assigned To:rasmus
 Block user comment: N

 New Comment:

The format "usern...@box" for local networks IS allowed when the mail()
method is used. I quote RFC 5321: "local aliases MUST NOT appear in any
SMTP transaction." They say NOTHING about mail() method in the RFC.


Previous Comments:

[2010-04-02 19:57:45] ras...@php.net

A much better RFC-compliant regex has been committed now.


[2010-04-02 19:56:39] ras...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=297350
Log: Update the FILTER_VALIDATE_EMAIL filter to fix bug #49576


[2010-04-02 07:40:29] ras...@php.net

Finally having a look at this.  Some of your cases are actually
incorrect 

according to RFC3696/RFC5322



For example.  ipinsteadofdom...@127.0.0.1 is not a valid email address
according 

to the RFC.  IPs in an email address must be in square brackets.  So it
should 

be ipinsteadofdom...@[127.0.0.1] for that one to be valid.  This is
valid under 

both RFC822 and RFC2822, but RFC3696 and RFC5322 updates those RFCs. 
And you 

can't have a port in it, so ipandp...@127.0.0.1:25 is invalid as well,
even if 

you added the square brackets.  Also we do not validate domains, so your
2 

examples of invalid TLDs are not relevant.



I'll have an update of the baked in regex soon, but it sounds like you
need to 

update the Kohana one as well.


[2009-09-17 08:53:51] mparkin at de-facto dot com

Description:

Filter_Var does not validate emails accurately enough, and false
positives are made. The regex needs improving - the regex we are using
in kohanaphp framework (with preg_match) is more accurate.



some more reading could be done here:



http://fightingforalostcause.net/misc/2006/compare-email-regex.php

Reproduce code:
---
http://codepad.org/UIrhI5ep

Expected result:

All emails in $valid are valid, all emails in $invalid are invalid.



A far more accurate regex can be found here:



http://dev.kohanaphp.com/projects/kohana2/repository/entry/trunk/system/helpers/valid.php#L20

Actual result:
--
There are false positives and non failures.










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


Bug #49600 [Com]: imageTTFText text shifted right

2010-08-05 Thread barts at hexon dot cx
Edit report at http://bugs.php.net/bug.php?id=49600&edit=1

 ID: 49600
 Comment by: barts at hexon dot cx
 Reported by:ch+php at -internet dot com
 Summary:imageTTFText text shifted right
 Status: Closed
 Type:   Bug
 Package:GD related
 Operating System:   FreeBSD 7.0
 PHP Version:5.2.11
 Assigned To:tabe
 Block user comment: N

 New Comment:

The fix for this bug was reverted in revision 296693, which fixed bug
#51263. Re-applying the patch for this bug will break the alignment of
angled text, so another solution is required.



Test script:





Expected:

$expected equals $actual



Actual result:

array(8) {

  [0]=>

  int(-1)

  [1]=>

  int(-1)

  [2]=>

  int(108)

  [3]=>

  int(-1)

  [4]=>

  int(108)

  [5]=>

  int(-21)

  [6]=>

  int(-1)

  [7]=>

  int(-21)

}

array(8) {

  [0]=>

  int(0)

  [1]=>

  int(0)

  [2]=>

  int(109)

  [3]=>

  int(0)

  [4]=>

  int(109)

  [5]=>

  int(-20)

  [6]=>

  int(0)

  [7]=>

  int(-20)

}


Previous Comments:

[2010-02-03 17:41:01] s...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294423
Log: - Merge #49600 (imageTTFText text shifted right)


[2010-01-08 12:18:53] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revision&revision=293268
Log: Bug #49600 (imageTTFText text shifted right)
- fix difference of horizontal position between imagettftext() and
imagettfbbox()


[2009-09-25 05:00:53] ch+php at -internet dot com

Just noticed that the text positioning between the two examples is
exactly the same - it's the bounding coordinates that changed. This
suggests that in <=5.2.9 BOTH the text and the boxes were shifted right
(which was less noticeable in practice since they were in sync - but a
closer inspection of the 5.2.9 example does show this). The bounding
coordinates are now where one would expect them to be, but that's not
where the text is.


[2009-09-19 17:49:44] paj...@php.net

Tabe, can you take a look at this bug please? The only change in this
area was the latest patch about bbox.


[2009-09-19 17:34:59] ch+php at -internet dot com

Here's the correct result produced by the same code example with 5.2.9:



http://www.-internet.com/images/php5_2_9_gdft_hpos.png




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/bug.php?id=49600


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


Bug #52492 [Bgs]: missing libmysql.dll, ext/php_pdo.dll, and ext/php_pspell.dll

2010-08-05 Thread aaron dot brown+php at oakadaptive dot com
Edit report at http://bugs.php.net/bug.php?id=52492&edit=1

 ID: 52492
 User updated by:aaron dot brown+php at oakadaptive dot com
 Reported by:aaron dot brown+php at oakadaptive dot com
 Summary:missing libmysql.dll, ext/php_pdo.dll, and
 ext/php_pspell.dll
 Status: Bogus
 Type:   Bug
 Package:Windows Installer
 Operating System:   Windows
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

> I will submit separate documentation bugs



Done:



http://bugs.php.net/bug.php?id=52543

http://bugs.php.net/bug.php?id=52544


Previous Comments:

[2010-08-04 23:03:47] aaron dot brown+php at oakadaptive dot com

Thank you for the response!



I will submit separate documentation bugs for



and  (which

both mention these DLLs and don't point out that they're not

used in PHP 5.3).



> PDO is builtin.  libmysql is not used anymore, 5.3.x uses

> mysqlnd (see the documentation or migration for more

> info).



Excellent; for others' reference:



- To get PDO to work I uncommented the php_pdo_*.dll

  extensions I was interested in but left

  "extension=php_pdo.dll" commented out.

- To get mysql_* functions to work I simply uncommented

  "extension=php_mysql.dll".


[2010-08-04 22:03:52] paj...@php.net

PDO is builtin. libmysql is not used anymore, 5.3.x uses mysqlnd (see
the documentation or migration for more info). pspell is not available
anymore, you can use enchant instead (which provides many backends like
openoffice dictionary).


[2010-08-04 20:24:10] aaron dot brown+php at oakadaptive dot com

I ran the corresponding installer,

,

but it doesn't have these files either.


[2010-07-30 21:11:02] aaron dot brown+php at oakadaptive dot com

Also missing:



  ext/php_pdo.dll

  ext/php_pspell.dll



(Or do I now need to compile PHP myself to get these?  All

three are included in php-5.2.14-Win32-VC6-x86.zip.)



http://www.php.net/manual/en/pdo.installation.php

http://www.php.net/manual/en/pspell.installation.php


[2010-07-29 23:56:45] aaron dot brown+php at oakadaptive dot com

Description:



says "A file named libmysql.dll is included in the Windows PHP

distribution", but there is no such file in

.









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


[PHP-BUG] Bug #52545 [NEW]: php_sybase_ct.dll is missing in VC9 build

2010-08-05 Thread toby at simmonsconsulting dot com
From: 
Operating system: Windows 2003
PHP version:  5.3.3
Package:  Windows Installer
Bug Type: Bug
Bug description:php_sybase_ct.dll is missing in VC9 build

Description:

This might be by design by I cannot find any documentation mentioning it.
It 

appears that the sybase_ct extension is missing in the current download of
5.3.3 

in both VC9 builds. The extension is present (ext/php_sybase_ct.dll) in the
VC6 

builds. According to http://bugs.php.net/bug.php?id=46971 from 2008-12-30
there 

were problems building it but that was 1.5 years ago.

Test script:
---
There is no test script needed, this is an installation issue.

Expected result:

The extension should (presumably) be present in the VC9 builds.

Actual result:
--
Missing extension.

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



Bug #31715 [Com]: isset() and empty() return "Trying to get property of non-object"

2010-08-05 Thread non at dot dot com
Edit report at http://bugs.php.net/bug.php?id=31715&edit=1

 ID: 31715
 Comment by: non at dot dot com
 Reported by:cryptographite at comcast dot net
 Summary:isset() and empty() return "Trying to get property
 of non-object"
 Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   FreeBSD
 PHP Version:5.0.3
 Assigned To:felipe
 Block user comment: N

 New Comment:

It's very confusing. I get ... on non-object ... error, too.

Im Using Ubuntu and it seems that ubuntu automaticly uses the suhosin
plugin.

Maybe the error is in this part of software.

The Object will be returned correctly.

My Object is of type Zend_Db_Table_Row_Abstract.

If i use var_dump($obj->text); it will return the text.

If i use gettype($obj) it will return the class name.

But if i try to use this in the view script i receive this confusing
error.

No solution =/


Previous Comments:

[2010-07-13 14:03:59] info at steffisgarten dot de

I'm experiencing the same problem using php 5.3.2 under Ubuntu Lucid
(5.3.2-1ubuntu4.2).

This is really annoying since the isset() function is supposed to check
whether the object exists or not, so the error makes so sense for me.


[2010-01-16 01:00:00] 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".


[2010-01-08 11:07:33] ahar...@php.net

Please try using this snapshot:

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

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

5.1.2 is an extremely old version of PHP. Please try again with a
current version.



FWIW, I can't reproduce this with 5.2.10-whatever-Ubuntu-ship or 5.3.1
-- the only notices are to do with the use of the undefined $key
variable as an array index, which are valid. The expected output is:



$not->set->variable

isset false

empty true

--

$not->set[$key]



Notice: Undefined variable: key in /tmp/test.php on line 11

isset false



Notice: Undefined variable: key in /tmp/test.php on line 13

empty true




[2010-01-08 10:12:43] ninuhadida at gmail dot com

I am experiencing the same problem with PHP 5.1.2 on SUSE Linux


[2005-02-04 01:00:06] 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".




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/bug.php?id=31715


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


Bug #31715 [Com]: isset() and empty() return "Trying to get property of non-object"

2010-08-05 Thread php at 28-n-half dot de
Edit report at http://bugs.php.net/bug.php?id=31715&edit=1

 ID: 31715
 Comment by: php at 28-n-half dot de
 Reported by:cryptographite at comcast dot net
 Summary:isset() and empty() return "Trying to get property
 of non-object"
 Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   FreeBSD
 PHP Version:5.0.3
 Assigned To:felipe
 Block user comment: N

 New Comment:

For example: (in view script)



{$index.'_heading1'};

$text = $obj->text;

var_dump($text);



?>



ends in an error ... on non-object ...



{$index.'_heading1'};

   $text = $obj->text;

   die(var_dump($text));



?>



returns the right string



... this can't be a fail on me =/ ...



All objects will be loaded correctly.

But if i try to access the object property it fails.

Please Email me on solution, i stucking in this problem.

Thanks in Advance


Previous Comments:

[2010-08-05 19:55:47] non at dot dot com

It's very confusing. I get ... on non-object ... error, too.

Im Using Ubuntu and it seems that ubuntu automaticly uses the suhosin
plugin.

Maybe the error is in this part of software.

The Object will be returned correctly.

My Object is of type Zend_Db_Table_Row_Abstract.

If i use var_dump($obj->text); it will return the text.

If i use gettype($obj) it will return the class name.

But if i try to use this in the view script i receive this confusing
error.

No solution =/


[2010-07-13 14:03:59] info at steffisgarten dot de

I'm experiencing the same problem using php 5.3.2 under Ubuntu Lucid
(5.3.2-1ubuntu4.2).

This is really annoying since the isset() function is supposed to check
whether the object exists or not, so the error makes so sense for me.


[2010-01-16 01:00:00] 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".


[2010-01-08 11:07:33] ahar...@php.net

Please try using this snapshot:

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

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

5.1.2 is an extremely old version of PHP. Please try again with a
current version.



FWIW, I can't reproduce this with 5.2.10-whatever-Ubuntu-ship or 5.3.1
-- the only notices are to do with the use of the undefined $key
variable as an array index, which are valid. The expected output is:



$not->set->variable

isset false

empty true

--

$not->set[$key]



Notice: Undefined variable: key in /tmp/test.php on line 11

isset false



Notice: Undefined variable: key in /tmp/test.php on line 13

empty true




[2010-01-08 10:12:43] ninuhadida at gmail dot com

I am experiencing the same problem with PHP 5.1.2 on SUSE Linux




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/bug.php?id=31715


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


Bug #31715 [Com]: isset() and empty() return "Trying to get property of non-object"

2010-08-05 Thread php at 28-n-half dot de
Edit report at http://bugs.php.net/bug.php?id=31715&edit=1

 ID: 31715
 Comment by: php at 28-n-half dot de
 Reported by:cryptographite at comcast dot net
 Summary:isset() and empty() return "Trying to get property
 of non-object"
 Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   FreeBSD
 PHP Version:5.0.3
 Assigned To:felipe
 Block user comment: N

 New Comment:

Ok, it was my fault. In my ZF View Helper I've used wrong conditions.

Never the less, mistery behaviour - i think on parsing side the object
was missed.

Sorry for the wrong alarm ;)


Previous Comments:

[2010-08-05 20:19:33] php at 28-n-half dot de

For example: (in view script)



{$index.'_heading1'};

$text = $obj->text;

var_dump($text);



?>



ends in an error ... on non-object ...



{$index.'_heading1'};

   $text = $obj->text;

   die(var_dump($text));



?>



returns the right string



... this can't be a fail on me =/ ...



All objects will be loaded correctly.

But if i try to access the object property it fails.

Please Email me on solution, i stucking in this problem.

Thanks in Advance


[2010-08-05 19:55:47] non at dot dot com

It's very confusing. I get ... on non-object ... error, too.

Im Using Ubuntu and it seems that ubuntu automaticly uses the suhosin
plugin.

Maybe the error is in this part of software.

The Object will be returned correctly.

My Object is of type Zend_Db_Table_Row_Abstract.

If i use var_dump($obj->text); it will return the text.

If i use gettype($obj) it will return the class name.

But if i try to use this in the view script i receive this confusing
error.

No solution =/


[2010-07-13 14:03:59] info at steffisgarten dot de

I'm experiencing the same problem using php 5.3.2 under Ubuntu Lucid
(5.3.2-1ubuntu4.2).

This is really annoying since the isset() function is supposed to check
whether the object exists or not, so the error makes so sense for me.


[2010-01-16 01:00:00] 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".


[2010-01-08 11:07:33] ahar...@php.net

Please try using this snapshot:

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

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

5.1.2 is an extremely old version of PHP. Please try again with a
current version.



FWIW, I can't reproduce this with 5.2.10-whatever-Ubuntu-ship or 5.3.1
-- the only notices are to do with the use of the undefined $key
variable as an array index, which are valid. The expected output is:



$not->set->variable

isset false

empty true

--

$not->set[$key]



Notice: Undefined variable: key in /tmp/test.php on line 11

isset false



Notice: Undefined variable: key in /tmp/test.php on line 13

empty true






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/bug.php?id=31715


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


Bug #51213 [Com]: pdo_mssql is trimming value of the money column

2010-08-05 Thread rgagnon24 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=51213&edit=1

 ID: 51213
 Comment by: rgagnon24 at gmail dot com
 Reported by:alexr at oplot dot com
 Summary:pdo_mssql is trimming value of the money column
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   Windows
 PHP Version:5.2.13
 Assigned To:iliaa
 Block user comment: N

 New Comment:

This closed bug which was recently made part of the 5.2.14 release
causes segmentation fault when a money type is fetched.



The patch supplied "pdo_mssql_money_column_conversion_fix" "last
revision 2010-03-05 09:38 UTC" works, but the committed code does not.



The spprintf() call is the cause of the segmentation fault as it is
sending incompatible pointer val->data as parameter 1 which appears to
be uninitialized pointer.  (val->data was never emalloc'd) 



Anyone using pdo_dblib will get a seg fault attempting to iterate
results with money results.


Previous Comments:

[2010-03-08 13:39:53] il...@php.net

This bug has been fixed in SVN.

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.




[2010-03-08 13:39:46] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=295958
Log: Fixed bug #51213 (pdo_mssql is trimming value of the money column).


[2010-03-05 10:36:45] alexr at oplot dot com

Description:

Money column is wrongly converting to the char column and this cause
that value is rounding to the 2 digits after delimiter (dot).

Test script:
---
$dsn = 'mssql:dbname=DBNAME;host=HOSTNAME';

$user = 'USERNAME';

$password='PASSWORD';

$dbh = new PDO($dsn, $user, $password);

$sth = $dbh->query  ('create table #tmp(col money)');

$sth = $dbh->query  ('insert into #tmp(col) values(-0.1234)');

$sth = $dbh->query  ('insert into #tmp(col) values(0.1234)');

$sth = $dbh->prepare('select * from #tmp');

$sth->execute();

$r = $sth->fetchAll(2);

print_r($r);

Expected result:

Array

(

[0] => Array

(

[col] => -0.1234

)



[1] => Array

(

[col] => 0.1234

)



)

Actual result:
--
Array

(

[0] => Array

(

[col] => -0.12

)



[1] => Array

(

[col] => 0.12

)



)






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


[PHP-BUG] Bug #52546 [NEW]: pdo_dblib segmentation fault when iterating MONEY values

2010-08-05 Thread rgagnon24 at gmail dot com
From: 
Operating system: CentOS 5.5
PHP version:  5.2.14
Package:  PDO related
Bug Type: Bug
Bug description:pdo_dblib segmentation fault when iterating MONEY values

Description:

Fix for bug 51213 released into 5.2.14 and 5.3.3 causes segmentation fault
when an SQL query attempts to read MSSQL MONEY type columns, or aggregates
of those column types.



Problem appears to be invalid val->data pointer passed to spprintf() call
at line 174 of dblib_stmt.c



Oddly, the patch attached to bug 51213 works properly, but is not the same
as what was comitted to the code base.



In the patch attached to 51213, val->data is properly emalloc'd some memory
before any sprintf()-type of operation is performed.

Test script:
---
// On a table containing a MONEY (field named "amount");



$sql = "SELECT SUM(amount) FROM table";

$rs = $pdo->query($sql, PDO::FETCH_OBJ);

foreach($rs as $row) {

   var_dump($row);

}

Expected result:

Expected to see rows dumped from table.

Actual result:
--
Segmentation fault.

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



Bug #51213 [Com]: pdo_mssql is trimming value of the money column

2010-08-05 Thread rgagnon24 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=51213&edit=1

 ID: 51213
 Comment by: rgagnon24 at gmail dot com
 Reported by:alexr at oplot dot com
 Summary:pdo_mssql is trimming value of the money column
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   Windows
 PHP Version:5.2.13
 Assigned To:iliaa
 Block user comment: N

 New Comment:

New bug opened as bug 52546 to deal with this new issue.


Previous Comments:

[2010-08-05 21:48:31] rgagnon24 at gmail dot com

This closed bug which was recently made part of the 5.2.14 release
causes segmentation fault when a money type is fetched.



The patch supplied "pdo_mssql_money_column_conversion_fix" "last
revision 2010-03-05 09:38 UTC" works, but the committed code does not.



The spprintf() call is the cause of the segmentation fault as it is
sending incompatible pointer val->data as parameter 1 which appears to
be uninitialized pointer.  (val->data was never emalloc'd) 



Anyone using pdo_dblib will get a seg fault attempting to iterate
results with money results.


[2010-03-08 13:39:53] il...@php.net

This bug has been fixed in SVN.

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.




[2010-03-08 13:39:46] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=295958
Log: Fixed bug #51213 (pdo_mssql is trimming value of the money column).


[2010-03-05 10:36:45] alexr at oplot dot com

Description:

Money column is wrongly converting to the char column and this cause
that value is rounding to the 2 digits after delimiter (dot).

Test script:
---
$dsn = 'mssql:dbname=DBNAME;host=HOSTNAME';

$user = 'USERNAME';

$password='PASSWORD';

$dbh = new PDO($dsn, $user, $password);

$sth = $dbh->query  ('create table #tmp(col money)');

$sth = $dbh->query  ('insert into #tmp(col) values(-0.1234)');

$sth = $dbh->query  ('insert into #tmp(col) values(0.1234)');

$sth = $dbh->prepare('select * from #tmp');

$sth->execute();

$r = $sth->fetchAll(2);

print_r($r);

Expected result:

Array

(

[0] => Array

(

[col] => -0.1234

)



[1] => Array

(

[col] => 0.1234

)



)

Actual result:
--
Array

(

[0] => Array

(

[col] => -0.12

)



[1] => Array

(

[col] => 0.12

)



)






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


Bug #51225 [Com]: cannot define a class with the same name as an interface

2010-08-05 Thread bobalicious dot bob at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=51225&edit=1

 ID: 51225
 Comment by: bobalicious dot bob at gmail dot com
 Reported by:tony at marston-home dot demon dot co dot uk
 Summary:cannot define a class with the same name as an
 interface
 Status: Assigned
 Type:   Bug
 Package:Class/Object related
 Operating System:   Windows XP
 PHP Version:5.2.13
 Assigned To:johannes
 Block user comment: N

 New Comment:

In my opinion, in order to be valid the code snippet should read:



if (!class_exists('foobar') && !interface_exists('foobar') ) {

class foobar{}

}



The error message on attempting to declare a class with the same name as
an 

interface should respond:

Cannot declare class as an interface exists with that name

The reverse message should also be possible.



It does not make sense to allow an interface and a class to have the
same name 

(type hinting is a great example why not), and 'class_exists' should
only refer 

to classes (the clue's in the name).



The confusion is merely down to an inaccurate error message.



Note: There's a reason it's not uncommon for people to prefix interfaces
with an 

'i'


Previous Comments:

[2010-03-08 10:35:06] tony at marston-home dot demon dot co dot uk

I disagree. class_exists() SHOULD check if that name has already been
declared as an interface otherwise you get the following situation:



if (!class_exists('foobar') {  // returns false

class foobar{} // fails because interface exists

}



On the one hand it is saying "a class with the name 'foobar' does not
exist" which is immediately followed by "you cannot create a class with
the name 'foobar' as it already exists". That is not logical to me.


[2010-03-08 00:55:52] johan...@php.net

I think the error message ("Cannot redeclare class") should be clearer
about classes and interfaces sharing the same namespace, which is needed
as type hints would be conflicting otherwise, but class_exists (by
default) should only check classes in my opinion. Any change should
consider that there's also interface_exists() and they should be
consistent.


[2010-03-08 00:28:39] der...@php.net

Yes, I agree.


[2010-03-08 00:23:50] tony at marston-home dot demon dot co dot uk

If an interface is a class, then it should show up in class_exists() and
get_declared_classes().


[2010-03-08 00:02:25] ka...@php.net

Thats how the OO is designed, internally is interfaces just a class with
an additional flag.



So no bug here




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/bug.php?id=51225


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


Bug #49301 [Com]: HAVE_GLOB is not detected correctly

2010-08-05 Thread lamont dot peterson at imail dot org
Edit report at http://bugs.php.net/bug.php?id=49301&edit=1

 ID: 49301
 Comment by: lamont dot peterson at imail dot org
 Reported by:php at stefan-marr dot de
 Summary:HAVE_GLOB is not detected correctly
 Status: Open
 Type:   Bug
 Package:Compile Failure
 Operating System:   Mac OS X 10.6, Solaris 5.10
 PHP Version:5.3.x
 Block user comment: N

 New Comment:

I'm building php-5.3.3 on Solaris 10 (5.10) on UltraSPARC T2 (Sun T2000)
systems.  I have working builds and then ran into this (configure?) bug
when I added "--with-iodbc" to the list of configure options.  Here's
the rest of my list of configure options:



'./configure' \

'--prefix=/usr/share' \

'--datadir=/usr/share/php' \

'--bindir=/usr/bin' \

'--libdir=/usr/share' \

'--includedir=/usr/include' \

'--with-config-file-path=/etc' \

'--with-exec-dir=/usr/lib/php/bin' \

'--disable-debug' \

'--enable-bcmath' \

'--enable-calendar' \

'--enable-ctype' \

'--enable-exif' \

'--enable-gd-native-ttf' \

'--enable-inline-optimization' \

'--enable-magic-quotes' \

'--enable-mbstring' \

'--enable-safe-mode' \

'--enable-shmop' \

'--enable-sigchild' \

'--enable-sysvsem' \

'--enable-sysvshm' \

'--enable-wddx' \

'--with-bz2' \

'--with-gdbm' \

'--with-gettext' \

'--with-gmp' \

'--with-jpeg-dir=/usr' \

'--with-ldap=yes' \

'--with-mcrypt' \

'--with-ndbm' \

'--with-pgsql=/usr' \

'--with-png-dir=/usr' \

'--with-t1lib' \

'--with-freetype-dir=yes' \

'--with-xpm-dir=/usr/X11R6' \

'--with-zlib=yes' \

'--with-gd=shared' \

'--with-openssl=/usr/local/ssl' \

'--with-curl' \

'--with-apxs2=/usr/local/bin/apxs'



If you add "--with-iodbc" to that list, it fails and I see the same
output as found in #51974 (marked as duplicate of this one).  I built
and installed libiodbc-3.52.7, only using the --disable-gui and
--disable-gtktest configure options.



I also tried this with php-5.3.2 and saw the same problem.


Previous Comments:

[2010-08-03 23:40:00] bogdan at trzebnica dot net

I try compile php5.3.3I have the same problem on debian lenny
2.6.26-2-amd64...On Debian 2.6.26-2-686 I can compile without
problem...What is wrong ? Help pls!


[2010-07-16 08:43:36] ras...@php.net

Just to clarify, this is a Solaris-only problem?  The OS field says OSX
10.6 as 

well and I am unable to reproduce the problem there.  My HAVE_GLOB is
picked up 

nicely and glob() works perfectly for me on OSX 10.6.4.


[2010-07-16 08:34:33] christian dot schaffer at muenchen dot de

#51974 http://bugs.php.net/bug.php?id=51974

#52345 http://bugs.php.net/bug.php?id=52345



Is this problem likely to be solved in the near future?


[2010-06-07 13:56:49] pooya_4075 at yahoo dot de

the snapshot http://snaps.php.net/php6.0-latest.tar.gz dont exists...



I tried other snapshots like php5.3-latest with the same result(Make:
Fatal error: Command failed for target `main/streams/glob_wrapper.lo')
!!!



Is there any other solution?



thanks


[2009-11-25 01:00:00] 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".




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/bug.php?id=49301


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


Bug #52546 [Opn->Csd]: pdo_dblib segmentation fault when iterating MONEY values

2010-08-05 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52546&edit=1

 ID: 52546
 Updated by: fel...@php.net
 Reported by:rgagnon24 at gmail dot com
 Summary:pdo_dblib segmentation fault when iterating MONEY
 values
-Status: Open
+Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   CentOS 5.5
 PHP Version:5.2.14
-Assigned To:
+Assigned To:felipe
 Block user comment: N

 New Comment:

This bug has been fixed in SVN.

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.


Previous Comments:

[2010-08-06 01:32:19] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=301916
Log: - Fixed bug #52546 (pdo_dblib segmentation fault when iterating
MONEY values)


[2010-08-05 22:04:37] rgagnon24 at gmail dot com

Description:

Fix for bug 51213 released into 5.2.14 and 5.3.3 causes segmentation
fault when an SQL query attempts to read MSSQL MONEY type columns, or
aggregates of those column types.



Problem appears to be invalid val->data pointer passed to spprintf()
call at line 174 of dblib_stmt.c



Oddly, the patch attached to bug 51213 works properly, but is not the
same as what was comitted to the code base.



In the patch attached to 51213, val->data is properly emalloc'd some
memory before any sprintf()-type of operation is performed.

Test script:
---
// On a table containing a MONEY (field named "amount");



$sql = "SELECT SUM(amount) FROM table";

$rs = $pdo->query($sql, PDO::FETCH_OBJ);

foreach($rs as $row) {

   var_dump($row);

}

Expected result:

Expected to see rows dumped from table.

Actual result:
--
Segmentation fault.






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


[PHP-BUG] Bug #52548 [NEW]: multiple $_POST array values not being assigned correctly

2010-08-05 Thread qrstuv+php at gmail dot com
From: 
Operating system: Ubuntu 10.04
PHP version:  Irrelevant
Package:  HTTP related
Bug Type: Bug
Bug description:multiple $_POST array values not being assigned correctly

Description:

The value of a $_POST array item is not being assigned properly

Test script:
---












Expected result:

//When "Continue without changes" is pressed, expected value:

NULL

Actual result:
--
//When "Continue without changes" is pressed...



//Actual value:

string(1) "C"



//The "C" is taken from the first character of the value of
$_POST['step4']

['edit']



//A var_dump of $_POST['step4']['edit'] returns the value as expected as
does a 

var_dump of $_POST['step4']['edit']['change'] when that is actually
pressed.

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



Bug #52548 [Opn->Bgs]: multiple $_POST array values not being assigned correctly

2010-08-05 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52548&edit=1

 ID: 52548
 Updated by: johan...@php.net
 Reported by:qrstuv+php at gmail dot com
 Summary:multiple $_POST array values not being assigned
 correctly
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:HTTP related
 Operating System:   Ubuntu 10.04
 PHP Version:Irrelevant
 Block user comment: N

 New Comment:

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

In your example $_POST['step4']['edit'] will be set to "Continue without
changes", the offset ['change'] will be used as string index, 'change'
is being casted to an integer value, 0, so the first character is
returned.


Previous Comments:

[2010-08-06 01:48:10] qrstuv+php at gmail dot com

Description:

The value of a $_POST array item is not being assigned properly

Test script:
---












Expected result:

//When "Continue without changes" is pressed, expected value:

NULL

Actual result:
--
//When "Continue without changes" is pressed...



//Actual value:

string(1) "C"



//The "C" is taken from the first character of the value of
$_POST['step4']

['edit']



//A var_dump of $_POST['step4']['edit'] returns the value as expected as
does a 

var_dump of $_POST['step4']['edit']['change'] when that is actually
pressed.






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


Bug #52548 [Com]: multiple $_POST array values not being assigned correctly

2010-08-05 Thread qrstuv+php at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52548&edit=1

 ID: 52548
 Comment by: qrstuv+php at gmail dot com
 Reported by:qrstuv+php at gmail dot com
 Summary:multiple $_POST array values not being assigned
 correctly
 Status: Bogus
 Type:   Bug
 Package:HTTP related
 Operating System:   Ubuntu 10.04
 PHP Version:Irrelevant
 Block user comment: N

 New Comment:

Ah, I understand. Thank you for your prompt response. Sorry for the
bogus report.


Previous Comments:

[2010-08-06 02:05:53] johan...@php.net

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

In your example $_POST['step4']['edit'] will be set to "Continue without
changes", the offset ['change'] will be used as string index, 'change'
is being casted to an integer value, 0, so the first character is
returned.


[2010-08-06 01:48:10] qrstuv+php at gmail dot com

Description:

The value of a $_POST array item is not being assigned properly

Test script:
---












Expected result:

//When "Continue without changes" is pressed, expected value:

NULL

Actual result:
--
//When "Continue without changes" is pressed...



//Actual value:

string(1) "C"



//The "C" is taken from the first character of the value of
$_POST['step4']

['edit']



//A var_dump of $_POST['step4']['edit'] returns the value as expected as
does a 

var_dump of $_POST['step4']['edit']['change'] when that is actually
pressed.






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


Bug #52545 [Opn->Asn]: php_sybase_ct.dll is missing in VC9 build

2010-08-05 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52545&edit=1

 ID: 52545
 Updated by: fel...@php.net
 Reported by:toby at simmonsconsulting dot com
 Summary:php_sybase_ct.dll is missing in VC9 build
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:Windows Installer
 Operating System:   Windows 2003
 PHP Version:5.3.3
-Assigned To:
+Assigned To:pajoye
 Block user comment: N



Previous Comments:

[2010-08-05 18:00:00] toby at simmonsconsulting dot com

Description:

This might be by design by I cannot find any documentation mentioning
it. It 

appears that the sybase_ct extension is missing in the current download
of 5.3.3 

in both VC9 builds. The extension is present (ext/php_sybase_ct.dll) in
the VC6 

builds. According to http://bugs.php.net/bug.php?id=46971 from
2008-12-30 there 

were problems building it but that was 1.5 years ago.

Test script:
---
There is no test script needed, this is an installation issue.

Expected result:

The extension should (presumably) be present in the VC9 builds.

Actual result:
--
Missing extension.






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


Bug #52539 [Opn->Asn]: Calling function from rebound Closure causes crash

2010-08-05 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52539&edit=1

 ID: 52539
 Updated by: fel...@php.net
 Reported by:cataphr...@php.net
 Summary:Calling function from rebound Closure causes crash
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Windows
 PHP Version:trunk-SVN-2010-08-05 (SVN)
-Assigned To:
+Assigned To:dmitry
 Block user comment: N



Previous Comments:

[2010-08-05 09:34:56] cataphr...@php.net

Description:

Calling a function in a rebound closure causes a crash.



This seems to be caused by dmitry's optimizations because this fixes the
issue:

#define CACHED_PTR(num) 0.

Test script:
---
class foo {

static function getClosure() {

return static function () {

//causes a crash (fbc not properly defined) in call 
after rebinding

echo get_called_class(), "\n";

};

}

}

 

class subFoo { }

 

$c = foo::getClosure();

$c(); //foo

$c = $c->bindTo(new subFoo());

$c(); //crash

Expected result:

No crash.

Actual result:
--
>   php5ts_debug.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data=0x025d2298, void * * * tsrm_ls=0x02784bf8)  Line 302 + 0x3
bytes   C

php5ts_debug.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data *
execute_data=0x025d2298, void * * * tsrm_ls=0x02784bf8)  Line 1721  C

php5ts_debug.dll!execute(_zend_op_array * op_array=0x025f23c8, void *
* * tsrm_ls=0x02784bf8)  Line 136 + 0x11 bytes  C

php5ts_debug.dll!zend_execute_scripts(int type=8, void * * *
tsrm_ls=0x02784bf8, _zval_struct * * retval=0x, int
file_count=3, ...)  Line 1193 + 0x21 bytes  C

php5ts_debug.dll!php_execute_script(_zend_file_handle *
primary_file=0x00aaf7b0, void * * * tsrm_ls=0x02784bf8)  Line 2330 +
0x1b bytes  C

php.exe!main(int argc=2, char * * argv=0x02784af8)  Line 1252 + 0x13
bytes   C








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


[PHP-BUG] Bug #52549 [NEW]: No 'M' in memory_limit variable returns 'Could not startup.' Possible mem leak?

2010-08-05 Thread zack_gold at yahoo dot com
From: 
Operating system: Linux (Arch Linux)
PHP version:  5.3.3
Package:  PHP options/info functions
Bug Type: Bug
Bug description:No 'M' in memory_limit variable returns 'Could not startup.' 
Possible mem leak?

Description:

When you put this into php.ini:

memory_limit = 50;



The output results in:

Could not startup.





There should be a notification to let you know that the memory_limit isn't
set 

properly. Maybe it's possible to do memory leaking or something like that
through 

this? My knowledge for memory-related stuff is one to none, but maybe
there's a 

potential bug here...

Test script:
---
Change php.ini memory_limit to "50" like so:



memory_limit = 50;


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



[PHP-BUG] Bug #52550 [NEW]: integer undefined behaviors executed during "make test"

2010-08-05 Thread regehr at cs dot utah dot edu
From: 
Operating system: linux
PHP version:  trunk-SVN-2010-08-06 (snap)
Package:  *General Issues
Bug Type: Bug
Bug description:integer undefined behaviors executed during "make test"

Description:

I run php-trunk-201008060430's "make test" under a tool that detects
integer undefined behaviors.  This is on an x86 box running Ubuntu 10.04. 
The list of problems is below.  Some of these could be security problems
waiting to happen.



Hopefully the error messages are self-explanatory.  If more details are
required, please let me know.



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 9 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32): 0
right (int32): -2147483648 



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32): 0
right (int32): -2147483648 



 : Op: +,
Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op: -,
Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32): 0
right (int32): -2147483648 



 :
Op: <<, Reason : Signed Left Shift Error: Right operand is negative or is
greater than or equal to the width of the promoted left operand, BINARY
OPERATION: left (int32): 0 right (int32): 65 



 :
Op: >>, Reason : Signed Right Shift Error: Right operand is negative or is
greater than or equal to the width of the promoted left operand, BINARY
OPERATION: left (int32): 0 right (int32): 65 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483647 right (int32): 1 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): -2147483648 right (int32): 1 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 255 right (int32): 16777216 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): 35 right (int32): 34 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): 35 right (int32): 33 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): 15 right (int32): 14 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): 15 right (int32): 13 



 : Op:
*, Reason : Signed Multiplication Overflow, BINARY OPERATION: left (int32):
1281072119 right (int32): 993 



 : Op:
-, Reason : Signed Subtraction Overflow, BINARY OPERATION: left (int32): 14
right (int32): -2147483648 



 : Op:
/, Reason : Divisor is 0, BINARY OPERATION: left (double): 1.00 right
(double): 0.00 



 : Op:
*, Reason : Signed Multiplication Overflow, BINARY OPERATION: left (int32):
1281072285 right (int32): 7685 



 : Op:
*, Reason : Signed Multiplication Overflow, BINARY OPERATION: left (int32):
1281072284 right (int32): 7583 



 : Op:
*, Reason : Signed Multiplication Overflow, BINARY OPERATION: left (int32):
1281072284 right (int32): 7581 



 : Op:
*, Reason : Signed Multiplication Overflow, BINARY OPERATION: left (int32):
1281072357 right (int32): 9099 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): -2147483647 right (int32): 9 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483647 right (int32): 1 



 : Op: +, Reason : Signed Addition Overflow, BINARY OPERATION:
left (int32): 2147483640 right (int32): 55 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION:
left (int32): -2147483601 right (int32): 48 



 : Op: %, Reason : Signed Modulus Error: The first
operand is INT_MIN, the second operand is -1, BINARY OPERATION: left
(int32): -2147483648 right (int32): -1 




-- 
Edit bug report at http://bugs.php.net/bug.php?id=52550&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52550&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52550&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52550&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52550&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52550&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52550&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52550&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52550&r=needscript
Try newer version:   
http://bugs.php.net/fi

Bug #52506 [Com]: remove "final" from exception's methods

2010-08-05 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=52506&edit=1

 ID: 52506
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:remove "final" from exception's methods
 Status: Open
 Type:   Bug
 Package:Class/Object related
 Operating System:   all
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

i know, but it is a request


Previous Comments:

[2010-08-05 06:28:13] crrrodriguez at opensuse dot org

Nope, See http://php.net/language.exceptions.extending.php


[2010-07-31 16:19:13] giorgio dot liscio at email dot it

Description:

hi, it is possible to remove the final modifier from the defined methods
in Exception?



they are incredibly limiting



thank you







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


Bug #52550 [Opn->Ana]: integer undefined behaviors executed during "make test"

2010-08-05 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 Updated by: ras...@php.net
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
-Status: Open
+Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

They don't make much sense to me.  Starting from the bottom,
conftest.cpp is a 

test file generated by the autoconf/libtool chain and only used during
the 

configure run.  So even if there was an issue in that, it really
wouldn't matter 

since no user data ever gets to it, and even if it did, you are
reporting it to 

the wrong project.



Next one up, ext/standard/var_unserializer.c line 228?  There is no
substraction 

there.  But assuming it means close to line 228, it would be in the
parse_iv2() 

function?  I see nothing wrong with that code.  The only code in it that
does 

any sort of addition is:



if (cursor >= '0' && cursor <= '9') {

result = result * 10 + cursor - '0';



How exactly do you get a signed subtraction overflow from that?  cursor
is 

constrained and result is initialized to 0.



The 3rd last one seems to point at the same code.



There may very well be bugs hiding in there, but a static analysis full
of false 

positives isn't very useful.


Previous Comments:

[2010-08-06 07:30:29] regehr at cs dot utah dot edu

Description:

I run php-trunk-201008060430's "make test" under a tool that detects
integer undefined behaviors.  This is on an x86 box running Ubuntu
10.04.  The list of problems is below.  Some of these could be security
problems waiting to happen.



Hopefully the error messages are self-explanatory.  If more details are
required, please let me know.



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 9 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 8 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 




: Op: <<, Reason : Signed Left Shift Error: Right operand is negative or
is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: >>, Reason : Signed Right Shift Error: Right operand is negative
or is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483647 right (int32): 1 




: Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): -2147483648 right (int32): 1 



 : Op: *, Reason : Signed Multiplication Overflow, BINARY
OPERATION: left (int32): 255 right (int32): 16777216 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 35 right (int32): 34 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 35 right (int32): 33 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 15 right (int32): 14 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 15 right (int32): 13 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072119 right (int32): 993 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): 14 right (int32): -2147483648 



 :
Op: /, Reason : Divisor is 0, BINARY OPERATION: left (double): 1.00
right (double): 0.00 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072285 right (int32): 7685 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072284 right (int32): 7583 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072284 right (int32): 7581 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072357 right (int32): 9099 




: Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 




: Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 




: Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 




: Op: -, R

Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-05 Thread regehr at cs dot utah dot edu
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 User updated by:regehr at cs dot utah dot edu
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

Hi--  It's not static analysis and there are no false positives.  These
behaviors really happen (unless our tool is buggy, of course this is
always possible).



Yes, I should have edited out the undefined behavior that occurred
during conftest.



My copy of var_unserializer.c has this code at line 228:



result = result * 10 + cursor - '0';



It looks to me like "result * 10 + cursor" evaluates to -2147483601 and
then the subtraction overflow occurs.  This is not obvious?  Anyway,
this is easy to verify: put an appropriate assertion in the code and run
"make test" yourself.


Previous Comments:

[2010-08-06 08:00:32] ras...@php.net

They don't make much sense to me.  Starting from the bottom,
conftest.cpp is a 

test file generated by the autoconf/libtool chain and only used during
the 

configure run.  So even if there was an issue in that, it really
wouldn't matter 

since no user data ever gets to it, and even if it did, you are
reporting it to 

the wrong project.



Next one up, ext/standard/var_unserializer.c line 228?  There is no
substraction 

there.  But assuming it means close to line 228, it would be in the
parse_iv2() 

function?  I see nothing wrong with that code.  The only code in it that
does 

any sort of addition is:



if (cursor >= '0' && cursor <= '9') {

result = result * 10 + cursor - '0';



How exactly do you get a signed subtraction overflow from that?  cursor
is 

constrained and result is initialized to 0.



The 3rd last one seems to point at the same code.



There may very well be bugs hiding in there, but a static analysis full
of false 

positives isn't very useful.


[2010-08-06 07:30:29] regehr at cs dot utah dot edu

Description:

I run php-trunk-201008060430's "make test" under a tool that detects
integer undefined behaviors.  This is on an x86 box running Ubuntu
10.04.  The list of problems is below.  Some of these could be security
problems waiting to happen.



Hopefully the error messages are self-explanatory.  If more details are
required, please let me know.



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 9 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 8 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 




: Op: <<, Reason : Signed Left Shift Error: Right operand is negative or
is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: >>, Reason : Signed Right Shift Error: Right operand is negative
or is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483647 right (int32): 1 




: Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): -2147483648 right (int32): 1 



 : Op: *, Reason : Signed Multiplication Overflow, BINARY
OPERATION: left (int32): 255 right (int32): 16777216 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 35 right (int32): 34 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 35 right (int32): 33 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 15 right (int32): 14 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 15 right (int32): 13 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072119 right (int32): 993 



 :
Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): 14 right (int32): -2147483648 



 :
Op: /, Reason : Divisor is 0, BINARY OPERATION: left (double): 1.00
right (double): 0.00 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072285 right (int32): 7685 



 :
Op: 

[PHP-BUG] Bug #52551 [NEW]: range() warns if step exceeds the distance between the min and max values

2010-08-05 Thread planet36 at gmail dot com
From: 
Operating system: Linux
PHP version:  trunk-SVN-2010-08-06 (snap)
Package:  *General Issues
Bug Type: Bug
Bug description:range() warns if step exceeds the distance between the min and 
max values

Description:

The range() function incorrectly warns when the step size exceeds the
distance between the min and the max values.  But when the min and max
values are equal, there is no warning.  This is related to #21060 and
#46631.



The documentation at 
gives no mention of possible warnings or errors.



The 'seq' utility is a good guide as to the expected output of the test
script.

$ seq 1 2 4

1

3



$ seq 1 2 3

1

3



$ seq 1 2 2

1



$ seq 1 2 1

1



Test script:
---
print "range(1, 4, 2)\n";

print_r(range(1, 4, 2));

print "\n";



print "range(1, 3, 2)\n";

print_r(range(1, 3, 2));

print "\n";



print "range(1, 2, 2)\n";

print_r(range(1, 2, 2));

print "\n";



print "range(1, 1, 2)\n";

print_r(range(1, 1, 2));

print "\n";

Expected result:

range(1, 4, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 3, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 2, 2)

Array

(

[0] => 1

)



range(1, 1, 2)

Array

(

[0] => 1

)

Actual result:
--
range(1, 4, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 3, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 2, 2)



Warning: range(): step exceeds the specified range in
/home/stevew/Desktop/PHP/php-trunk-201008060430/sapi/cli/test-range.php on
line 16



range(1, 1, 2)

Array

(

[0] => 1

)

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



Bug #52551 [Opn]: range() warns if step exceeds the distance between the min and max values

2010-08-05 Thread planet36 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52551&edit=1

 ID: 52551
 User updated by:planet36 at gmail dot com
 Reported by:planet36 at gmail dot com
 Summary:range() warns if step exceeds the distance between
 the min and max values
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   Linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

uname --all

Linux ubuntu 2.6.32-24-generic-pae #38-Ubuntu SMP Mon Jul 5 10:54:21 UTC
2010 i686 GNU/Linux



./php --version

PHP 5.3.99-dev (cli) (built: Aug  6 2010 01:43:07) 

Copyright (c) 1997-2010 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies


Previous Comments:

[2010-08-06 08:22:32] planet36 at gmail dot com

Description:

The range() function incorrectly warns when the step size exceeds the
distance between the min and the max values.  But when the min and max
values are equal, there is no warning.  This is related to #21060 and
#46631.



The documentation at 
gives no mention of possible warnings or errors.



The 'seq' utility is a good guide as to the expected output of the test
script.

$ seq 1 2 4

1

3



$ seq 1 2 3

1

3



$ seq 1 2 2

1



$ seq 1 2 1

1



Test script:
---
print "range(1, 4, 2)\n";

print_r(range(1, 4, 2));

print "\n";



print "range(1, 3, 2)\n";

print_r(range(1, 3, 2));

print "\n";



print "range(1, 2, 2)\n";

print_r(range(1, 2, 2));

print "\n";



print "range(1, 1, 2)\n";

print_r(range(1, 1, 2));

print "\n";

Expected result:

range(1, 4, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 3, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 2, 2)

Array

(

[0] => 1

)



range(1, 1, 2)

Array

(

[0] => 1

)

Actual result:
--
range(1, 4, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 3, 2)

Array

(

[0] => 1

[1] => 3

)



range(1, 2, 2)



Warning: range(): step exceeds the specified range in
/home/stevew/Desktop/PHP/php-trunk-201008060430/sapi/cli/test-range.php
on line 16



range(1, 1, 2)

Array

(

[0] => 1

)






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


Bug #52550 [Ana]: integer undefined behaviors executed during "make test"

2010-08-05 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=52550&edit=1

 ID: 52550
 Updated by: ras...@php.net
 Reported by:regehr at cs dot utah dot edu
 Summary:integer undefined behaviors executed during "make
 test"
 Status: Analyzed
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:trunk-SVN-2010-08-06 (snap)
 Block user comment: N

 New Comment:

No, it isn't obvious since that line of code is only executed when the
value of 

cursor is between '0' and '9'.  It would require the argument to
parse_iv2() to be  

above MAXINT which re2c checks for earlier.


Previous Comments:

[2010-08-06 08:10:22] regehr at cs dot utah dot edu

Hi--  It's not static analysis and there are no false positives.  These
behaviors really happen (unless our tool is buggy, of course this is
always possible).



Yes, I should have edited out the undefined behavior that occurred
during conftest.



My copy of var_unserializer.c has this code at line 228:



result = result * 10 + cursor - '0';



It looks to me like "result * 10 + cursor" evaluates to -2147483601 and
then the subtraction overflow occurs.  This is not obvious?  Anyway,
this is easy to verify: put an appropriate assertion in the code and run
"make test" yourself.


[2010-08-06 08:00:32] ras...@php.net

They don't make much sense to me.  Starting from the bottom,
conftest.cpp is a 

test file generated by the autoconf/libtool chain and only used during
the 

configure run.  So even if there was an issue in that, it really
wouldn't matter 

since no user data ever gets to it, and even if it did, you are
reporting it to 

the wrong project.



Next one up, ext/standard/var_unserializer.c line 228?  There is no
substraction 

there.  But assuming it means close to line 228, it would be in the
parse_iv2() 

function?  I see nothing wrong with that code.  The only code in it that
does 

any sort of addition is:



if (cursor >= '0' && cursor <= '9') {

result = result * 10 + cursor - '0';



How exactly do you get a signed subtraction overflow from that?  cursor
is 

constrained and result is initialized to 0.



The 3rd last one seems to point at the same code.



There may very well be bugs hiding in there, but a static analysis full
of false 

positives isn't very useful.


[2010-08-06 07:30:29] regehr at cs dot utah dot edu

Description:

I run php-trunk-201008060430's "make test" under a tool that detects
integer undefined behaviors.  This is on an x86 box running Ubuntu
10.04.  The list of problems is below.  Some of these could be security
problems waiting to happen.



Hopefully the error messages are self-explanatory.  If more details are
required, please let me know.



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 9 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 :
Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483640 right (int32): 8 



 :
Op: -, Reason : Signed Subtraction Overflow, UNARY OPERATION: left
(int32): 0 right (int32): -2147483648 



 : Op:
+, Reason : Signed Addition Overflow, BINARY OPERATION: left (int32):
2147483640 right (int32): 8 



 : Op:
-, Reason : Signed Subtraction Overflow, UNARY OPERATION: left (int32):
0 right (int32): -2147483648 




: Op: <<, Reason : Signed Left Shift Error: Right operand is negative or
is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: >>, Reason : Signed Right Shift Error: Right operand is negative
or is greater than or equal to the width of the promoted left operand,
BINARY OPERATION: left (int32): 0 right (int32): 65 




: Op: +, Reason : Signed Addition Overflow, BINARY OPERATION: left
(int32): 2147483647 right (int32): 1 




: Op: -, Reason : Signed Subtraction Overflow, BINARY OPERATION: left
(int32): -2147483648 right (int32): 1 



 : Op: *, Reason : Signed Multiplication Overflow, BINARY
OPERATION: left (int32): 255 right (int32): 16777216 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 35 right (int32): 34 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 35 right (int32): 33 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 15 right (int32): 14 



 : Op: -, Reason : Signed Subtraction Overflow, BINARY
OPERATION: left (int32): 15 right (int32): 13 



 :
Op: *, Reason : Signed Multiplication Overflow, BINARY OPERATION: left
(int32): 1281072119 right (int32): 993 



 :
Op: -, Reason :