003.phpt 663 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. shm_detach() tests
  3. --EXTENSIONS--
  4. sysvshm
  5. --SKIPIF--
  6. <?php
  7. if (!function_exists('ftok')){ print 'skip'; }
  8. ?>
  9. --FILE--
  10. <?php
  11. $key = ftok(__DIR__."/003.phpt", 'q');
  12. $s = shm_attach($key);
  13. var_dump(shm_detach($s));
  14. try {
  15. shm_detach($s);
  16. } catch (Error $exception) {
  17. echo $exception->getMessage() . "\n";
  18. }
  19. try {
  20. shm_remove($s);
  21. } catch (Error $exception) {
  22. echo $exception->getMessage() . "\n";
  23. }
  24. echo "Done\n";
  25. ?>
  26. --CLEAN--
  27. <?php
  28. $key = ftok(__DIR__."/003.phpt", 'q');
  29. $s = shm_attach($key);
  30. shm_remove($s);
  31. ?>
  32. --EXPECT--
  33. bool(true)
  34. Shared memory block has already been destroyed
  35. Shared memory block has already been destroyed
  36. Done