-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For compatibility with tentative types added in PHP 8.1.
- Loading branch information
Showing
5 changed files
with
62 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,27 +13,19 @@ public function __construct( | |
int $chunk_size = 0, | ||
int $list = APC_LIST_ACTIVE); | ||
|
||
/** @return void */ | ||
public function rewind(); | ||
public function rewind(): void; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
GrahamCampbell
|
||
|
||
/** @return void */ | ||
public function next(); | ||
public function next(): void; | ||
|
||
/** @return bool */ | ||
public function valid(); | ||
public function valid(): bool; | ||
|
||
/** @return string|int|false */ | ||
public function key(); | ||
public function key(): string|int; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
/** @return mixed */ | ||
public function current(); | ||
public function current(): mixed; | ||
|
||
/** @return int */ | ||
public function getTotalHits(); | ||
public function getTotalHits(): int; | ||
|
||
/** @return int */ | ||
public function getTotalSize(); | ||
public function getTotalSize(): int; | ||
|
||
/** @return int */ | ||
public function getTotalCount(); | ||
public function getTotalCount(): int; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
APCUIterator key() and current() on invalid iterator | ||
--SKIPIF-- | ||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> | ||
--INI-- | ||
apc.enabled=1 | ||
apc.enable_cli=1 | ||
--FILE-- | ||
<?php | ||
|
||
apcu_store("key1", "value1"); | ||
|
||
$it = new APCuIterator(null, APC_ITER_VALUE); | ||
var_dump($it->key()); | ||
var_dump($it->current()); | ||
$it->next(); | ||
|
||
try { | ||
var_dump($it->key()); | ||
} catch (Error $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
try { | ||
var_dump($it->current()); | ||
} catch (Error $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
string(4) "key1" | ||
array(1) { | ||
["value"]=> | ||
string(6) "value1" | ||
} | ||
Cannot call key() on invalid iterator | ||
Cannot call current() on invalid iterator |
isn't this a major breaking change to a non-final class?