為什么我沒(méi)有辦法輸出$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
舉報(bào)
2018-09-21
對(duì)象怎么輸出。。
2018-06-25
可能因?yàn)?e是一個(gè)對(duì)象,printf沒(méi)法直接輸出
2018-05-31
顯示的結(jié)果是PHP Parse error:? syntax error, unexpected T_VARIABLE in index.php on line 9