backtrace.phpt 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --TEST--
  2. Extra named params in backtraces
  3. --FILE--
  4. <?php
  5. function test($a, ...$rest) {
  6. var_dump(debug_backtrace());
  7. debug_print_backtrace();
  8. throw new Exception("Test");
  9. }
  10. try {
  11. test(1, 2, x: 3, y: 4);
  12. } catch (Exception $e) {
  13. var_dump($e->getTrace());
  14. echo $e, "\n";
  15. }
  16. ?>
  17. --EXPECTF--
  18. array(1) {
  19. [0]=>
  20. array(4) {
  21. ["file"]=>
  22. string(%d) "%s"
  23. ["line"]=>
  24. int(10)
  25. ["function"]=>
  26. string(4) "test"
  27. ["args"]=>
  28. array(4) {
  29. [0]=>
  30. int(1)
  31. [1]=>
  32. int(2)
  33. ["x"]=>
  34. int(3)
  35. ["y"]=>
  36. int(4)
  37. }
  38. }
  39. }
  40. #0 %s(10): test(1, 2, x: 3, y: 4)
  41. array(1) {
  42. [0]=>
  43. array(4) {
  44. ["file"]=>
  45. string(%d) "%s"
  46. ["line"]=>
  47. int(10)
  48. ["function"]=>
  49. string(4) "test"
  50. ["args"]=>
  51. array(4) {
  52. [0]=>
  53. int(1)
  54. [1]=>
  55. int(2)
  56. ["x"]=>
  57. int(3)
  58. ["y"]=>
  59. int(4)
  60. }
  61. }
  62. }
  63. Exception: Test in %s:%d
  64. Stack trace:
  65. #0 %s(%d): test(1, 2, x: 3, y: 4)
  66. #1 {main}