summaryrefslogtreecommitdiff
path: root/CHANGES.current
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2021-05-26 08:56:41 +1200
committerOlly Betts <olly@survex.com>2021-05-26 09:39:43 +1200
commit17a294cec4bb99d37ed01b99787fad483326792f (patch)
treeb5f45f0c271c0e2aabb04773f9ce4487a214b68a /CHANGES.current
parentcdc69f9843a9b153a91109a493702e089f48602f (diff)
downloadswig-17a294cec4bb99d37ed01b99787fad483326792f.tar.gz
Replace remaining PHP errors with PHP exceptions
`SWIG_ErrorCode()`, `SWIG_ErrorMsg()`, `SWIG_FAIL()` and `goto thrown;` are no longer supported (these are really all internal implementation details and none are documented aside from brief mentions in CHANGES for the first three). I wasn't able to find any uses at least in FOSS code via code search tools. If you are using these: Use `SWIG_PHP_Error(code,msg);` instead of `SWIG_ErrorCode(code); SWIG_ErrorMsg(msg);` (which will throw a PHP exception in SWIG >= 4.1 and do the same as the individual calls in older SWIG). `SWIG_FAIL();` and `goto thrown;` can typically be replaced with `SWIG_fail;`. This will probably also work with older SWIG, but please test with your wrappers if this is important to you. Fixes #2014
Diffstat (limited to 'CHANGES.current')
-rw-r--r--CHANGES.current30
1 files changed, 26 insertions, 4 deletions
diff --git a/CHANGES.current b/CHANGES.current
index 388df8698..9ab912b15 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -8,11 +8,33 @@ Version 4.1.0 (in progress)
===========================
2021-05-04: olly
- [PHP] #2014 Throw exceptions instead of using errors
+ [PHP] #2014 Throw PHP exceptions instead of using PHP errors
- Parameter type errors and some other cases in SWIG-generated wrappers
- now throw a PHP exception, which is how PHP's native parameter handling
- deals with similar situations.
+ PHP exceptions can be caught and handled if desired, but if they
+ aren't caught then PHP exits in much the same way as it does for a
+ PHP error.
+
+ In particular this means parameter type errors and some other cases
+ in SWIG-generated wrappers now throw a PHP exception, which matches
+ how PHP's native parameter handling deals with similar situations.
+
+ `SWIG_ErrorCode()`, `SWIG_ErrorMsg()`, `SWIG_FAIL()` and `goto thrown;`
+ are no longer supported (these are really all internal implementation
+ details and none are documented aside from brief mentions in CHANGES
+ for the first three). I wasn't able to find any uses in user interface
+ files at least in FOSS code via code search tools.
+
+ If you are using these:
+
+ Use `SWIG_PHP_Error(code,msg);` instead of `SWIG_ErrorCode(code);
+ SWIG_ErrorMsg(msg);` (which will throw a PHP exception in SWIG >= 4.1
+ and do the same as the individual calls in older SWIG).
+
+ `SWIG_FAIL();` and `goto thrown;` can typically be replaced with
+ `SWIG_fail;`. This will probably also work with older SWIG, but
+ please test with your wrappers if this is important to you.
+
+ *** POTENTIAL INCOMPATIBILITY ***
2021-05-17: adr26
[Python] #1985 Fix memory leaks: