We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to create an expression that has zero as the parameter value. However, the parameters incorrectly show as empty.
$expr = new \Zend\Db\Sql\Expression('?', '0'); print_r($expr->getParameters());
It prints "0"
It prints empty array
https://github.com/zendframework/zend-db/blob/master/src/Sql/Expression.php#L59
In Zend\Db\Sql\Expression, update the constructor to explicitly check for '0' when setting parameters
Zend\Db\Sql\Expression
if ($parameters || $parameters === '0') { $this->setParameters($parameters); }
Originally posted by @albertor24 at zendframework/zend-db#381
The text was updated successfully, but these errors were encountered:
@albertor24 Please submit PR and add test to cover your case 👍
Originally posted by @michalbundyra at zendframework/zend-db#381 (comment)
Sorry, something went wrong.
I seems already fixed. I tried it:
➜ laminas-db git:(master) php -a Interactive shell php > include 'vendor/autoload.php'; php > $expr = new \Zend\Db\Sql\Expression('?', '0'); php > print_r($expr->getParameters()); 0
I'm closing it.
No branches or pull requests
I am trying to create an expression that has zero as the parameter value. However, the parameters incorrectly show as empty.
Code to reproduce the issue
Expected results
It prints "0"
Actual results
It prints empty array
Proposed fix
https://github.com/zendframework/zend-db/blob/master/src/Sql/Expression.php#L59
In
Zend\Db\Sql\Expression
, update the constructor to explicitly check for '0' when setting parametersOriginally posted by @albertor24 at zendframework/zend-db#381
The text was updated successfully, but these errors were encountered: