根据我正在阅读的书,print未实现的 ing 对象__toString()应该会引发错误:
Object of class popp\ch04\batch22\Person could not be converted to string ...
当我尝试这样做时,我收到一条消息Process finished with exit code 255,但没有描述性错误。我正在使用 PhpStorm。
<?php
class Person{}
$person = new Person();
try {
print $person;
} catch(Exception $e) {
print $e;
}
我应该启用一个开关来接收错误吗?