1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Files
archived-php-src/ext/sysvshm/tests/003.phpt
T
Nikita Popov 1df8175b61 Convert fetch_resource warnings into TypeErrors
More type checks that are not part of zpp and should generate a
TypeError in PHP 8.
2019-06-03 09:17:12 +02:00

42 lines
707 B
PHP

--TEST--
shm_detach() tests
--SKIPIF--
<?php
if (!extension_loaded("sysvshm")){ print 'skip'; }
if (!function_exists('ftok')){ print 'skip'; }
?>
--FILE--
<?php
$key = ftok(__DIR__."/003.phpt", 'q');
$s = shm_attach($key);
var_dump(shm_detach($s));
try {
var_dump(shm_detach($s));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
shm_remove($s);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "Done\n";
?>
--CLEAN--
<?php
$key = ftok(__DIR__."/003.phpt", 'q');
$s = shm_attach($key);
shm_remove($s);
?>
--EXPECT--
bool(true)
shm_detach(): supplied resource is not a valid sysvshm resource
shm_remove(): supplied resource is not a valid sysvshm resource
Done