var_dump( 引数 )
<?php $str = "abcde"; var_dump($str); print_r($str); ?> ●実行結果 string(5) "abcde" abcde
<?php $array = array("key1"=>"aaa","key2"=>"bbb"); var_dump($array); print_r($array); ?> ●実行結果 array(2) { ["key1"]=> string(3) "aaa" ["key2"]=> string(3) "bbb" } Array ( [key1] => aaa [key2] => bbb )
<?php class TestClass { private $str; function getData() { return $this->str; } } $obj = new TestClass(); var_dump($obj); print_r($obj); ?> ●実行結果 object(TestClass)#1 (1) { ["str:private"]=> NULL } TestClass Object ( [str:private] => )