Skip to content

Instantly share code, notes, and snippets.

@danpoltawski
Created December 17, 2013 03:27
Show Gist options
  • Select an option

  • Save danpoltawski/7999574 to your computer and use it in GitHub Desktop.

Select an option

Save danpoltawski/7999574 to your computer and use it in GitHub Desktop.
php drives me to insanity
$ cat test.php
<?php
// Dear php, please give me a function which will show the type of
// the variable, without capturing output buffer myself..
$x = floor('1.2');
echo 'var_export:'.var_export($x, true)."\n";
echo 'print_r:'.print_r($x, true)."\n";
echo 'var_dump:';
var_dump($x);
$ php test.php
var_export:1
print_r:1
var_dump:double(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment