Title: Var_dump debug not working
Last modified: February 6, 2020

---

# Var_dump debug not working

 *  [webbuildermn](https://wordpress.org/support/users/webbuildermn/)
 * (@webbuildermn)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/var_dump-debug-not-working/)
 * Hi, When i put this in my plugin.php file outside of functions, it works. When
   I put them in a function, I just get a white screen surrounded by the admin panel.
   I want to `change the value of $posts to $myvariable
 *     ```
       $posts = get_posts();
       echo '<pre>';
       var_dump($posts);
       echo '</pre>';
       die();
       ```
   
 * Also when I turn debug on on my local site, I don’t get the info at the top of
   the site. It simply looks the same. I do get the log turned on.
 * I need to debug, I need these tools or I feel I won’t get very far.
 * Can you use var_dump inside a function in a plugin? How else could you read the
   value of variables while the code runs and requests are sent?
 * Here’s my code in the WP-config.php file in case you’re doubting me, not inside
   comments in the correct folder for my local site. I’m using local by flywheel
   btw.
 *     ```
       define( 'WP_DEBUG', true);
   
       define( 'WP_DEBUG_LOG', true);
   
       define( 'WP_DEBUG_DISPLAY', true);
       ```
   
 * Thank you guys

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [mzaheerdad](https://wordpress.org/support/users/zaheerdad/)
 * (@zaheerdad)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/var_dump-debug-not-working/#post-12404491)
 * Hi,
 * Please post your complete code of both cases success and fail
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [6 years, 3 months ago](https://wordpress.org/support/topic/var_dump-debug-not-working/#post-12405739)
 * Moved to Fixing WordPress, this is not an Developing with WordPress topic.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Var_dump debug not working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/var_dump-debug-not-working/#post-12405739)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
