Skip to content

Commit

Permalink
There was still an error, my bad
Browse files Browse the repository at this point in the history
I hadn't realized count(false) returned 1
  • Loading branch information
nabab committed Jun 22, 2018
1 parent ccd0745 commit 6519c03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PHPSQLParser/processors/SQLProcessor.php
Expand Up @@ -62,7 +62,8 @@ public function process($tokens) {
$out = false;

// $tokens may come as a numeric indexed array starting with an index greater than 0 (or as a boolean)
if ( $tokenCount = count($tokens) ){
$tokenCount = count($tokens);
if ( is_array($tokens) ){
$tokens = array_values($tokens);
}
for ($tokenNumber = 0; $tokenNumber < $tokenCount; ++$tokenNumber) {
Expand Down

0 comments on commit 6519c03

Please sign in to comment.