bug60634_error_2.phpt 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during 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. }
  17. function read($id) {
  18. return '';
  19. }
  20. function write($id, $session_data) {
  21. echo "write: goodbye cruel world\n";
  22. throw new Exception;
  23. }
  24. function destroy($id) {
  25. return true;
  26. }
  27. function gc($maxlifetime) {
  28. return true;
  29. }
  30. session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
  31. session_start();
  32. session_write_close();
  33. echo "um, hi\n";
  34. ?>
  35. --EXPECTF--
  36. write: goodbye cruel world
  37. Fatal error: Uncaught exception 'Exception' in %s
  38. Stack trace:
  39. #0 [internal function]: write('%s', '')
  40. #1 %s(%d): session_write_close()
  41. #2 {main}
  42. thrown in %s on line %d