Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,21 @@ rewritten to comply with these rules.
1. Extensions should be well tested using `*.phpt` tests. Read more at
[qa.php.net](https://qa.php.net/write-test.php) documentation.

2. When testing exceptions, assert the error class in the catch block.

```diff
try {
throw new ValueError('foo');
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}

--EXPECT--
- foo
+ ValueError: foo
```

## New and experimental functions

To reduce the problems normally associated with the first public implementation
Expand Down