FAQ
Commit: 6dbf1d517fa11a05f75f5655225e278d93918c56
Author: Rasmus Lerdorf <rasmus@php.net> Sun, 8 Mar 2015 11:38:31 -0700
Parents: 5948cbf89d80c607995d3fb33a4ecf79aa9aa3ab
Branches: master

Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=6dbf1d517fa11a05f75f5655225e278d93918c56

Log:
Engine exceptions

Changed paths:
   M slides/intro/php7_2015.xml


Diff:
diff --git a/slides/intro/php7_2015.xml b/slides/intro/php7_2015.xml
index 223d9ac..733e05d 100644
--- a/slides/intro/php7_2015.xml
+++ b/slides/intro/php7_2015.xml
@@ -36,6 +36,28 @@ echo $a ?? $b ?? $c; // 1
  echo $a ?? $x ?? $c; // 2
  ]]></example>

+<break lines="1" section="php7excep"/>
+<blurb fontsize="1.1em" align="left">✔ Exceptions on Fatals</blurb>
+<example fontsize="1.5em" result='0' title=""><![CDATA[
+<?php
+function call_method($obj) {
+ $obj->method();
+}
+
+call_method(null);
+// Fatal error: Call to a member function method() on a non-object
+]]></example>
+
+<example fontsize="1.5em" result='0' title=""><![CDATA[
+<?php
+try {
+ call_method(null);
+} catch (EngineException $e) {
+ echo "Exception: {$e->getMessage()}\n";
+}
+// Exception: Call to a member function method() on a non-object
+]]></example>
+
  <break lines="1" section="php7cleanups"/>
  <blurb fontsize="1.1em" align="left">✔ Removal of many deprecated featuresBR/
       (Your PHP4 code will break!)</blurb>

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupphp-pres @
categoriesphp
postedMar 8, '15 at 6:58p
activeMar 8, '15 at 6:58p
posts1
users1
websitephp.net

1 user in discussion

Rasmus Lerdorf: 1 post

People

Translate

site design / logo © 2017 Grokbase