#22712 [NEW]: number_format rounding differences for floats and strings

2003-03-14 Thread hpdl at oscommerce dot com
From: hpdl at oscommerce dot com
Operating system: Linux
PHP version:  4.3.1
PHP Bug Type: Math related
Bug description:  number_format rounding differences for floats and strings

We at osCommerce are witnessing rounding problems in our 
taxes logic and have made a reproduceable script below. 
 
number_format() produces different rounding results when 
floats or strings are passed to the function. 
 
' . "\n" . 
   'number_format($price, 2): ' . 
number_format($price, 2) . '' . "\n" . 
   'number_format((string)$price, 2): ' . 
number_format((string)$price, 2); 
?> 
 
The correct results are produced when the string value is 
passed. The float value produces incorrect results. 
 
I do not know if this is a problem with the number_format 
function, or if it is due to floats/mathematics. 
-- 
Edit bug report at http://bugs.php.net/?id=22712&edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22712&r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22712&r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22712&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22712&r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22712&r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22712&r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22712&r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22712&r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22712&r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22712&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22712&r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22712&r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22712&r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22712&r=gnused



#28352 [NEW]: Referencing Global Variables

2004-05-10 Thread hpdl at oscommerce dot com
From: hpdl at oscommerce dot com
Operating system: Linux
PHP version:  4.3.4
PHP Bug Type: Session related
Bug description:  Referencing Global Variables

Description:

A global variable which references a session variable 
inside a class loses its global scope. 

Reproduce code:
---
';

echo 'reload';
?>

Expected result:

The counter shown should be incremented on each page 
reload. 

Actual result:
--
The counter does not get incremented and stays at 1. 
 
Changing the following line: 
 
$b =& $_SESSION['a']; 
 
to: 
 
$GLOBALS['b'] =& $_SESSION['a']; 
 
produces the expected result. 

-- 
Edit bug report at http://bugs.php.net/?id=28352&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28352&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28352&r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=28352&r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=28352&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28352&r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=28352&r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=28352&r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=28352&r=support
Expected behavior:  http://bugs.php.net/fix.php?id=28352&r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=28352&r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=28352&r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=28352&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28352&r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=28352&r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=28352&r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=28352&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28352&r=float


[PHP-BUG] Bug #54289 [NEW]: Phar::extractTo() does not accept specific directories to be extracted

2011-03-17 Thread hpdl at oscommerce dot com
From: 
Operating system: MacOS 10.6.6
PHP version:  5.3.5
Package:  PHAR related
Bug Type: Bug
Bug description:Phar::extractTo() does not accept specific directories to be 
extracted

Description:

Phar::extractTo() does not allow specific directories to be extracted. The


documentation states the second parameter can be a file or directory to
only 

extract the file or directory from the phar archive.



Specific files can be extracted however an exception is thrown when a
directory is 

passed.

Test script:
---
buildFromDirectory('/path/to/source');

  unset($phar);



  $phar = new Phar('/tmp/test.phar');

  $phar->extractTo('/tmp/test/', 'subdir1/subdir2/', true); // throws
exception

//  $phar->extractTo('/tmp/test/', 'subdir1/subdir2/file.txt', true); //
works as intended

?>



Expected result:

The specific directory should be extracted from the phar archive.

Actual result:
--
Fatal error: Uncaught exception 'PharException' with message 'Phar Error: 

attempted to extract non-existent file "subdir1/subdir2/" from phar 

"/tmp/test.phar"' in /phar-test.php on line 7

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



Bug #54289 [Com]: Phar::extractTo() does not accept specific directories to be extracted

2011-08-11 Thread hpdl at oscommerce dot com
Edit report at https://bugs.php.net/bug.php?id=54289&edit=1

 ID: 54289
 Comment by: hpdl at oscommerce dot com
 Reported by:hpdl at oscommerce dot com
 Summary:Phar::extractTo() does not accept specific
 directories to be extracted
 Status: Open
 Type:   Bug
 Package:PHAR related
 Operating System:   MacOS 10.6.6
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Bug still exists in PHP 5.3.7RC5.


Previous Comments:

[2011-03-17 10:44:06] hpdl at oscommerce dot com

Description:

Phar::extractTo() does not allow specific directories to be extracted. The 
documentation states the second parameter can be a file or directory to only 
extract the file or directory from the phar archive.

Specific files can be extracted however an exception is thrown when a directory 
is 
passed.

Test script:
---
buildFromDirectory('/path/to/source');
  unset($phar);

  $phar = new Phar('/tmp/test.phar');
  $phar->extractTo('/tmp/test/', 'subdir1/subdir2/', true); // throws exception
//  $phar->extractTo('/tmp/test/', 'subdir1/subdir2/file.txt', true); // works 
as intended
?>


Expected result:

The specific directory should be extracted from the phar archive.

Actual result:
--
Fatal error: Uncaught exception 'PharException' with message 'Phar Error: 
attempted to extract non-existent file "subdir1/subdir2/" from phar 
"/tmp/test.phar"' in /phar-test.php on line 7






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