rfc:finally
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:finally [2012/07/27 15:13] – [Patch] laruence | rfc:finally [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2012/07/24 | * Date: 2012/07/24 | ||
- | * Author: Xinchen Hui < | + | * Author: Xinchen Hui < |
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
+ | * Alternative Reading: <Finally Getting finally In PHP?> http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 12: | Line 13: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | $db = mysql_connect(); | + | $db = mysqli_connect(); |
try { | try { | ||
| | ||
} catch (Exception $e) { | } catch (Exception $e) { | ||
- | mysql_close($db); | + | mysqli_close($db); |
throw $e; | throw $e; | ||
} | } | ||
Line 28: | Line 29: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | $db = mysql_connect(); | + | $db = mysqli_connect(); |
try { | try { | ||
| | ||
} finally { | } finally { | ||
- | mysql_close($db); | + | mysqli_close($db); |
} | } | ||
</ | </ | ||
Line 50: | Line 51: | ||
</ | </ | ||
- | the above script will outpu: | + | the above script will output: |
< | < | ||
this will be called | this will be called | ||
Line 86: | Line 87: | ||
123432int(1) | 123432int(1) | ||
</ | </ | ||
+ | |||
+ | There are also lots of edge cases could be found in the Test& | ||
===== Patch ===== | ===== Patch ===== | ||
* Patch: https:// | * Patch: https:// | ||
- | * Tests & Examples: | + | ===== Tests & Examples |
* https:// | * https:// | ||
* https:// | * https:// | ||
Line 98: | Line 101: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | |||
+ | ===== Vote ===== | ||
+ | < | ||
+ | title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Changelog ===== | ===== Changelog ===== | ||
* 2012/07/24 Xinchen Hui: Initial version | * 2012/07/24 Xinchen Hui: Initial version | ||
* 2012/07/26 Xinchen Hui: Update RFC | * 2012/07/26 Xinchen Hui: Update RFC | ||
+ | * 2012/08/06 Xinchen Hui: Open voting | ||
+ | * 2012/08/13 Xinchen Hui: Close voting, RFC win the voting | ||
+ | * 2012/08/15 Xinchen Hui: Committed |
rfc/finally.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1