為什么我沒有辦法輸出$e?
<?php
$filename = 'test.txt';
try {
??? if (!file_exists($filename)) {
????? throw new Exception('文件不存在');
??? }
} catch(Exception $e) {
??? echo $e->getMessage();
??? printf $e;
??? // var_dump $e;
}
<?php
$filename = 'test.txt';
try {
??? if (!file_exists($filename)) {
????? throw new Exception('文件不存在');
??? }
} catch(Exception $e) {
??? echo $e->getMessage();
??? printf $e;
??? // var_dump $e;
}
2018-05-31
舉報
2018-09-21
對象怎么輸出。。
2018-06-25
可能因為$e是一個對象,printf沒法直接輸出
2018-05-31
顯示的結果是PHP Parse error:? syntax error, unexpected T_VARIABLE in index.php on line 9