Skip to content

Commit 9d92d56

Browse files
committed
Use array_key_first()
Same results, but simpler and faster code. Note array_key_first() is available on PHP 7.3+, which is thankfully the minimum PHP version required by CodeIgniter.
1 parent 2a08bc7 commit 9d92d56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

system/Database/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ protected function compileBinds()
281281

282282
$binds = (array) $this->binds;
283283

284-
if (is_int(key(array_slice($binds, 0, 1)))) {
284+
if (is_int(array_key_first($binds))) {
285285
$bindCount = count($binds);
286286
$ml = strlen($this->bindMarker);
287287

0 commit comments

Comments
 (0)