<?php class Girl { public $id = 1; public $name = 'zhy'; } $start = microtime(TRUE); var_dump(get_class_vars(get_class(new Girl()))); $end = microtime(TRUE); echo " " . ($end - $start) . " "; $start = microtime(TRUE); var_dump((array)(new Girl())); $end = microtime(TRUE); echo " " . ($end - $start) . " ";
一次测试,只看一次的测试: