php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68295 Warning: stats_stat_powersum(): Both value and power are zero
Submitted: 2014-10-24 06:04 UTC Modified: 2016-05-28 05:23 UTC
From: jane at inventis dot be Assigned: uchiyama (profile)
Status: Closed Package: stats (PECL)
PHP Version: 5.4.34 OS: Mac OS X 10.9.5
Private report: No CVE-ID: None
 [2014-10-24 06:04 UTC] jane at inventis dot be
Description:
------------
---
From manual page: http://www.php.net/function.stats-stat-powersum
---
stats_stat_powersum throws a warning if one of the array values given as first argument is 0, but the power argument is not

Warning: stats_stat_powersum(): Both value and power are zero

------------------------
My Configure Command
------------------------
'./configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php5.4.34' '--exec-prefix=/Applications/MAMP/bin/php/php5.4.34' '--sysconfdir=/Applications/MAMP/bin/php/php5.4.34/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php5.4.34/conf' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip' '--with-iconv=/Applications/MAMP/Library'

Test script:
---------------
<?php
echo stats_stat_powersum([1,2,0] , 2);
?>

Expected result:
----------------
5

but without the warning


Patches

fix-stats_stat_powersum-zero-check (last revision 2014-10-25 16:52 UTC by php at mcq8 dot be)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-28 00:24 UTC] uchiyama@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: uchiyama
 [2016-05-28 05:23 UTC] uchiyama@php.net
-Status: Assigned +Status: Closed
 [2016-05-28 05:23 UTC] uchiyama@php.net
Fixed in version 1.0.4/2.0.2
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC