[PHP-BUG] Bug #62112 [NEW]: Regression in number_format() in PHP 5.4

2012-05-22 Thread lstro...@php.net
From: lstrojny
Operating system: Linux
PHP version:  5.4.3
Package:  Math related
Bug Type: Bug
Bug description:Regression in number_format() in PHP 5.4

Description:

In PHP 5.3.X, passing a null byte as decimal point lead to no decimal point
at 
all. This is not so much problematic for userland, as for C extensions. For

examlpe phpredis uses it internally (see 
https://github.com/nicolasff/phpredis/blob/master/redis.c#L3665) to format
a 
number. This worked fine in PHP 5.3, but with PHP 5.4 only the first
character 
until the first decimal point is returned.

Test script:
---
php -r 'var_dump(number_format(2000.1, 0, ".", "\x00"));'

Expected result:

string(4) "2000"

Actual result:
--
string(1) "2"

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



Bug #62112 [Com]: Regression in number_format() in PHP 5.4

2012-05-22 Thread lstro...@php.net
Edit report at https://bugs.php.net/bug.php?id=62112&edit=1

 ID: 62112
 Comment by: lstro...@php.net
 Reported by:lstro...@php.net
 Summary:Regression in number_format() in PHP 5.4
 Status: Open
 Type:   Bug
 Package:Math related
 Operating System:   Linux
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

See this pull request for the proposed fix: https://github.com/php/php-
src/pull/87


Previous Comments:

[2012-05-22 20:17:40] lstro...@php.net

Description:

In PHP 5.3.X, passing a null byte as decimal point lead to no decimal point at 
all. This is not so much problematic for userland, as for C extensions. For 
examlpe phpredis uses it internally (see 
https://github.com/nicolasff/phpredis/blob/master/redis.c#L3665) to format a 
number. This worked fine in PHP 5.3, but with PHP 5.4 only the first character 
until the first decimal point is returned.

Test script:
---
php -r 'var_dump(number_format(2000.1, 0, ".", "\x00"));'

Expected result:

string(4) "2000"

Actual result:
--
string(1) "2"






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


Bug #62112 [Com]: Regression in number_format() in PHP 5.4

2012-05-22 Thread lstro...@php.net
Edit report at https://bugs.php.net/bug.php?id=62112&edit=1

 ID: 62112
 Comment by: lstro...@php.net
 Reported by:lstro...@php.net
 Summary:Regression in number_format() in PHP 5.4
 Status: Open
 Type:   Bug
 Package:Math related
 Operating System:   Linux
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

Sorry, link is broken: https://github.com/php/php-src/pull/87


Previous Comments:

[2012-05-22 21:28:07] lstro...@php.net

See this pull request for the proposed fix: https://github.com/php/php-
src/pull/87


[2012-05-22 20:17:40] lstro...@php.net

Description:

In PHP 5.3.X, passing a null byte as decimal point lead to no decimal point at 
all. This is not so much problematic for userland, as for C extensions. For 
examlpe phpredis uses it internally (see 
https://github.com/nicolasff/phpredis/blob/master/redis.c#L3665) to format a 
number. This worked fine in PHP 5.3, but with PHP 5.4 only the first character 
until the first decimal point is returned.

Test script:
---
php -r 'var_dump(number_format(2000.1, 0, ".", "\x00"));'

Expected result:

string(4) "2000"

Actual result:
--
string(1) "2"






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


Req #45351 [Com]: Exception::getTrace() should return 'object' array-element

2013-01-04 Thread lstro...@php.net
Edit report at https://bugs.php.net/bug.php?id=45351&edit=1

 ID: 45351
 Comment by: lstro...@php.net
 Reported by:lasse100 at planet dot nl
 Summary:Exception::getTrace() should return 'object'
 array-element
 Status: Open
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:5.3
 Block user comment: N
 Private report: N

 New Comment:

A test is missing for the new functionality.


Previous Comments:

[2012-08-16 07:38:05] jachym dot tousek at gmail dot com

Why is this feature not yet integrated in PHP?


[2008-06-24 20:23:26] lasse100 at planet dot nl

Description:

As in function debug_backtrace(), the method Exception::getTrace() should 
return a array with a 'object' element, representing the current object.

The method Exception::getTrace() should also have a $provide_object parameter 
like the parameter in function debug_backtrace(), to disable the 
'object'-element in the array.

Reproduce code:
---
bar = $bar;
echo 'debug_backtrace: ';
var_dump(debug_backtrace());
echo '';
throw new Exception('Foo throws an exception!');
}
}
try {
$foo = new Foo('test');
} catch (Exception $e) {
echo 'Exception::getTrace(): ';
var_dump($e->getTrace());
echo '';
}
?>

Expected result:

debug_backtrace:

array(1) {
  [0]=>
  array(7) {
["file"]=>
string(50) "C:\server\apache\htdocs\forum\htdocs\bugreport.php"
["line"]=>
int(13)
["function"]=>
string(11) "__construct"
["class"]=>
string(3) "Foo"
["object"]=>
object(Foo)#1 (1) {
  ["bar"]=>
  string(4) "test"
}
["type"]=>
string(2) "->"
["args"]=>
array(1) {
  [0]=>
  &string(4) "test"
}
  }
}

Exception::getTrace():

array(1) {
  [0]=>
  array(6) {
["file"]=>
string(50) "C:\server\apache\htdocs\forum\htdocs\bugreport.php"
["line"]=>
int(13)
["function"]=>
string(11) "__construct"
["class"]=>
string(3) "Foo"
["object"]=>
object(Foo)#1 (1) {
  ["bar"]=>
  string(4) "test"
}
["type"]=>
string(2) "->"
["args"]=>
array(1) {
  [0]=>
  string(4) "test"
}
  }
}

Actual result:
--
debug_backtrace:

array(1) {
  [0]=>
  array(7) {
["file"]=>
string(50) "C:\server\apache\htdocs\forum\htdocs\bugreport.php"
["line"]=>
int(13)
["function"]=>
string(11) "__construct"
["class"]=>
string(3) "Foo"
["object"]=>
object(Foo)#1 (1) {
  ["bar"]=>
  string(4) "test"
}
["type"]=>
string(2) "->"
["args"]=>
array(1) {
  [0]=>
  &string(4) "test"
}
  }
}

Exception::getTrace():

array(1) {
  [0]=>
  array(6) {
["file"]=>
string(50) "C:\server\apache\htdocs\forum\htdocs\bugreport.php"
["line"]=>
int(13)
["function"]=>
string(11) "__construct"
["class"]=>
string(3) "Foo"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
  [0]=>
  string(4) "test"
}
  }
}






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