Skip to content

Commit 2392728

Browse files
authored
Initialize profiler property to null in Statement class
In PHP, ?-> still reads the property first; an uninitialized typed property throws before it can evaluate as null. Signed-off-by: Mathias Berchtold <mberchtold@gmail.com>
1 parent 2812e87 commit 2392728

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/Statement.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class Statement implements StatementInterface, DriverAwareInterface, Profi
2727

2828
protected Driver $driver;
2929

30-
protected ?ProfilerInterface $profiler;
30+
protected ?ProfilerInterface $profiler = null;
3131

3232
protected string $sql = '';
3333

0 commit comments

Comments
 (0)