PHP division may return float or int, depending on the operands. [1]
Make sure all numbers are of the same type (floats), because
XmlSelect compares values with ===.
[1] http://php.net/manual/en/language.operators.arithmetic.php
Bug: T199566
Change-Id: I37df6fd425f47d9a4562d83e04fcb50c3b97e0da
] ) );
asort( $hours );
- $select = new XmlSelect( 'days', 'days', $selectedHours / 24 );
+ $select = new XmlSelect( 'days', 'days', (float)( $selectedHours / 24 ) );
foreach ( $hours as $value ) {
if ( $value < 24 ) {
} else {
$name = $this->msg( 'days' )->numParams( $value / 24 )->text();
}
- $select->addOption( $name, $value / 24 );
+ $select->addOption( $name, (float)( $value / 24 ) );
}
return $select->getHTML() . "\n<br />\n";