In this workaround you can find how to have a better var_dump in PHP (because the built-in one is ugly).

My current environment is as follows

  • PHP5.5.14
  • MAMP Server (Regular)
  • OS X Mavericks
  1. Make pear in MAMP accessible by adding the following code inside your bash_profile
alias mpear='/Applications/MAMP/bin/php/php5.5.14/bin/pear'

Normally, you need to restart Terminal to trigger the new command.

  1. Set pear to the current php.ini. It should be done to make sure your pear does not associate with another version of PHP (which you don’t want).
/Applications/MAMP/bin/php/php5.5.14/conf/php.ini
  1. Install var_dump extension via Pear
mpear install Var_Dump-1.0.4

Notice that in my case, it should be mpear. It depends on how you choose in your bash_profile`

  1. Verify if it works by some PHP codes
include_once 'Var_Dump.php';
Var_Dump::display ( $dummyValue );