CakePHP 3.6.13 and PHP 7.2.5: Stacktrace not showing

We’ve recently updated our CakePHP 3 project to PHP 7.2.5 (from 5.6.36). We’ve noticed that the stacktrace no longer shows when an error is thrown.

Example: https://imgur.com/a/qk1XOzX

In the screenshots above is the same example error running locally. No settings were changed, just ran it on 7.2.5 then again on 5.6.36.

Any ideas why this has changed?

try updating both files in