php中的Throwables和ParseError
发布时间:2020-12-13 16:08:04 所属栏目:PHP教程 来源:网络整理
导读:? php // Throwables//ParseError try { include ‘config.php‘ ;} catch (ParseError $e ) { echo ‘ParseError handling‘ ; echo ‘br/‘ ;} class Address { private $customer ; public function __construct(Customer $customer ) { $this -customer
<?php //Throwables //ParseError try { include ‘config.php‘; } catch (ParseError $e) { echo ‘ParseError handling‘; echo ‘<br/>‘; } class Address { private $customer; public function __construct(Customer $customer) { $this->customer = $customer; } } $customer = new stdClass(); try { $address = new Address($customer); } catch (Throwable $t) { echo ‘Throwable handling‘; echo ‘<br/>‘; } finally { echo ‘cleanup‘; echo ‘<br/>‘; } ?> 输出 ParseError handling
Throwable handling
cleanup
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |