Skip to content
This repository was archived by the owner on Jun 10, 2019. It is now read-only.

Warning: A non-numeric value encountered in lib/Zend/Locale/Math/PhpMath.php on line 94 #125

Open
cscarnell98 opened this issue Nov 15, 2017 · 3 comments

Comments

@cscarnell98
Copy link

This is with Magneto EE 1.14.3.6 running PHP 7.1 with Inchoo PHP 7 module installed - creating a new CMS page in Magento.

Warning: A non-numeric value encountered  in 
lib/Zend/Locale/Math/PhpMath.php on line 94

#0 lib/Zend/Locale/Math/PhpMath.php(94): mageCoreErrorHandler(2, 'A non-numeric v...', '...', 94, Array)
#1 lib/Zend/Locale/Format.php(385): Zend_Locale_Math_PhpMath::Sub('0', '', 0)
#2 lib/Zend/Locale/Format.php(662): Zend_Locale_Format::toNumber('', Array)
#3 lib/Zend/Filter/NormalizedToLocalized.php(106): Zend_Locale_Format::toFloat('', Array)
#4 app/code/core/Mage/Core/Controller/Varien/Action.php(994): Zend_Filter_NormalizedToLocalized->filter('')
#5 app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php(248): Mage_Core_Controller_Varien_Action->_filterDates(Array, Array)
#6 app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php(129): Mage_Adminhtml_Cms_PageController->_filterPostData(Array)
#7 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Cms_PageController->saveAction()
#8 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('save')
#9 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#11 app/Mage.php(691): Mage_Core_Model_App->run(Array)
#12 index.php(109): Mage::run('default', 'store')
#13 {main}
@ivanweiler
Copy link
Contributor

ivanweiler commented Jan 24, 2018

I can't reproduce it but it's most likely that I can't guess right combination :)
But I see that PhpMath class isn't used by Zend when bcmath extension is enabled, so enabling bcmath in php could maybe solve the problem?

Related to #97

@kiatng
Copy link

kiatng commented Feb 21, 2018

I can replicate with a new install of CE 1.9.3.x with Inchoo_PHP7 2.2.0 on PHP 7.1.13:

admin > CMS > Pages > Edit Page 'Home page' >click Save button > Warning: A non-numeric value encountered in .../lib/Zend/Locale/Math/PhpMath.php on line 94

To fix this, I edited lib/Zend/Locale/Math/PhpMath.php

// at line 92, insert the following
if (empty($op2)) {
    $op2 = 0;
}

@kiatng
Copy link

kiatng commented Feb 21, 2018

As suggested by @ivanweiler, installing bcmath removed the error:

yum --enablerepo=remi-php71 install php-bcmath

So there is no need to mess with core file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants