WarpConduit Computing

  • Quick Tips
  • Web Design & Development
  • Graphic Design
  • Home
  • WordPress Plugins
  • Password Generator
  • About
  • Contact

Listing available variables, constants, functions, classes in PHP

January 25, 2011 by Josh Hartman

A short post today to help you in debugging your applications. You may find yourself someday wondering what variables are currently set and their contents, or what constants have been set by an application or framework you are coding. Well the answer is rather simple using var_dump function. Here is the breakdown:

List all defined variables with their respective values:

var_dump(get_defined_vars());

List all defined constants with their respective values:

var_dump(get_defined_constants());

List all defined internal and user functions:

var_dump(get_defined_functions());

List all declared classes:

var_dump(get_declared_classes());

That’s it, I hope you get some use out of these functions like i did!

Filed Under: Web Design & Development Tagged With: classes, constants, dump, functions, list, php, variables

Connect

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • YouTube

Recent Posts

  • Extremely Useful Applications for Web Development and IT Tasks
  • Installing BookStack Wiki on cPanel Shared Hosting
  • Media (MIME) Type Reference List

Tags

automatic benchmark cbc cipher class comparisons cpanel credit memo css decrypt encrypt font gzip htaccess html image increment javascript jquery list magento mcrypt mysql number old opencart order php profiling random redirect repository rijndael shipment software strict ubuntu url wincachegrind windows windows 7 wordpress xampp xdebug xss

Blogroll

  • CodeIgniter
  • Fusion Forward
  • jQuery
  • Nettuts+
  • Smashing Magazine

© 2023 WarpConduit Computing. All Rights Reserved.