Variable Dumping Post Requests in PHP

PHP Logo
PHP manual on var_dump

This is a brilliant way to dump variables to a webserver’s error log in The source of this code snippet. This is especially helpful when experimenting with POST requests in barebone environments.

php
<?php
ob_start();
var_dump($this);
error_log(ob_get_clean());
30 April 2019 — Written
30 April 2019 — Updated
Thedro Neely — Creator
variable-dump-to-error-log.md — Article

More Content

Openring

Web Ring

Comments

References

  1. https://thedroneely.com/git/
  2. https://thedroneely.com/
  3. https://thedroneely.com/posts/
  4. https://thedroneely.com/projects/
  5. https://thedroneely.com/about/
  6. https://thedroneely.com/contact/
  7. https://thedroneely.com/abstracts/
  8. https://ko-fi.com/thedroneely
  9. https://thedroneely.com/tags/php/
  10. https://thedroneely.com/tags/snippets/
  11. https://thedroneely.com/posts/variable-dump-to-error-log/#isso-thread
  12. https://thedroneely.com/posts/rss.xml
  13. https://thedroneely.com/images/variable-dump-to-error-log.png
  14. https://gist.github.com/mkolb/2379498
  15. https://thedroneely.com/posts/variable-dump-to-error-log/#code-block-89249e0
  16. https://www.thedroneely.com/posts/variable-dump-to-error-log.md
  17. https://thedroneely.com/projects/bulma-resume/
  18. https://thedroneely.com/posts/good-evil-and-the-law/
  19. https://thedroneely.com/posts/adding-headroom-with-javascript/
  20. https://git.sr.ht/~sircmpwn/openring
  21. https://drewdevault.com/2022/11/12/In-praise-of-Plan-9.html
  22. https://drewdevault.com/
  23. https://mxb.dev/blog/the-indieweb-for-everyone/
  24. https://mxb.dev/
  25. https://www.taniarascia.com/simplifying-drag-and-drop/
  26. https://www.taniarascia.com/
  27. https://thedroneely.com/posts/variable-dump-to-error-log#isso-thread
  28. https://thedroneely.com/posts/variable-dump-to-error-log#code-block-89249e0
  29. https://thedroneely.com/projects/news-aggregator/
  30. https://thedroneely.com/posts/bitcoin-hacked-email-scam/
  31. https://thedroneely.com/archives/abstracts/
  32. https://thedroneely.com/posts/typesetting-in-latex/
  33. https://thedroneely.com/abstracts/the-myth-of-the-rational-voter/
  34. https://drewdevault.com/2022/09/16/Open-source-matters.html
  35. https://mxb.dev/blog/make-free-stuff/
  36. https://thedroneely.com/sitemap.xml
  37. https://thedroneely.com/index.json
  38. https://thedroneely.com/resume/
  39. https://gitlab.com/tdro
  40. https://github.com/tdro
  41. https://codeberg.org/tdro
  42. https://thedroneely.com/analytics
  43. https://thedroneely.com/posts/variable-dump-to-error-log#
  44. https://creativecommons.org/licenses/by-sa/2.0/
  45. https://thedroneely.com/git/thedroneely/thedroneely.com
  46. https://opensource.org/licenses/GPL-3.0
  47. https://www.thedroneely.com/
  48. https://thedroneely.com/posts/variable-dump-to-error-log/#