boucle new object php code example Example: php loop through class properties foreach ($obj as $key => $value) { echo "$key => $value\n"; }