-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
Success parameters should respect property types | ||
--SKIPIF-- | ||
<?php | ||
require_once(dirname(__FILE__) . '/skipif.inc'); | ||
version_compare(PHP_VERSION, '7.4.0dev', '>=') or die('skip Requires PHP >= 7.4'); | ||
?> | ||
--INI-- | ||
apc.enabled=1 | ||
apc.enable_cli=1 | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
public bool $bool = false; | ||
public array $array = []; | ||
} | ||
|
||
$test = new Test; | ||
apcu_store('foo', 'bar'); | ||
apcu_fetch('foo', $test->bool); | ||
var_dump($test->bool); | ||
try { | ||
apcu_fetch('foo', $test->array); | ||
} catch (Error $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
var_dump($test->array); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
Cannot assign bool to reference held by property Test::$array of type array | ||
array(0) { | ||
} |