The following code returns a negative value after entering a float value. What am I doing wrong, is it a problem in the code? Because in PHP 8.0 there is no problem.
$memcached = new Memcached();
$memcached->addServer('memcached.sock', 0, 1);
Class Test {
public float $value1 = 123.00;
public float $value2 = 100.00;
public int $value3 = 2;
}
$test = new Test();
$memcached->set('KEYFLOATSET1', $test->value1, 5);
$memcached->set('KEYFLOATSET2', $test->value2, 5);
$memcached->set('KEYFLOATSET3', $test->value3, 5);
var_dump($memcached->get('KEYFLOATSET1'));
var_dump($memcached->get('KEYFLOATSET2'));
var_dump($memcached->get('KEYFLOATSET3'));
The following code returns a negative value after entering a float value. What am I doing wrong, is it a problem in the code? Because in PHP 8.0 there is no problem.