1.The __toString() magic method is only called when used directly with echo or print — if any other strings or casts are present, the object id will be returned instead.
在我的测试中发现不是很正确。都可以输出__toString的值
2.$input_file = array_map(‘rtrim’, file(‘generic.txt’));
This line of code achieves the same effect. file() returns an array containing the lines of generic.txt; array_map() applies the function rtrim() to each element of that array, and returns the resulting “trimmed” array.