bug60634_error_4.phpt 906 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write after exec
  3. --INI--
  4. session.save_path=
  5. session.name=PHPSESSID
  6. --SKIPIF--
  7. <?php include('skipif.inc'); ?>
  8. --FILE--
  9. <?php
  10. ob_start();
  11. function open($save_path, $session_name) {
  12. return true;
  13. }
  14. function close() {
  15. echo "close: goodbye cruel world\n";
  16. exit;
  17. }
  18. function read($id) {
  19. return '';
  20. }
  21. function write($id, $session_data) {
  22. echo "write: goodbye cruel world\n";
  23. throw new Exception;
  24. }
  25. function destroy($id) {
  26. return true;
  27. }
  28. function gc($maxlifetime) {
  29. return true;
  30. }
  31. session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
  32. session_start();
  33. ?>
  34. --EXPECTF--
  35. write: goodbye cruel world
  36. Fatal error: Uncaught exception 'Exception' in %s
  37. Stack trace:
  38. #0 [internal function]: write('%s', '')
  39. #1 {main}
  40. thrown in %s on line %d
  41. close: goodbye cruel world