Skip to content

Fix issue raised by PHP 8.1 #486

New issue

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

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix test for PHP 8.1
  • Loading branch information
remicollet committed Jun 9, 2021
commit 899e4dc27c672b1617a232e9757809bf0dd5b89a
21 changes: 8 additions & 13 deletions tests/undefined_set.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,25 @@ $m = memc_get_instance ();
$key = 'foobarbazDEADC0DE';
$value = array('foo' => 'bar');

$rv = $m->set($no_key, $value, 360);
// silent to hide:
// Warning: Undefined variable
// Deprecated: Memcached::set(): Passing null to parameter (PHP 8.1)

$rv = @$m->set($no_key, $value, 360);
var_dump($rv);


$rv = $m->set($key, $no_value, 360);
$rv = @$m->set($key, $no_value, 360);
var_dump($rv);

$rv = $m->set($no_key, $no_value, 360);
$rv = @$m->set($no_key, $no_value, 360);
var_dump($rv);

$rv = $m->set($key, $value, $no_time);
$rv = @$m->set($key, $value, $no_time);
var_dump($rv);
?>
--EXPECTF--
%s: Undefined variable%sno_key in %s
bool(false)

%s: Undefined variable%sno_value in %s
bool(true)

%s: Undefined variable%sno_key in %s

%s: Undefined variable%sno_value in %s
bool(false)

%s: Undefined variable%sno_time in %s
bool(true)