Declare(strict_types=1) vs error_reporting(-1)

<?php
declare(strict_types=1);

error_reporting(0);

echo substr(new stdclass(), 0, 1);

Just declaring strict types here doesn’t help, because substr is not defined in the current file, so strict doesn’t apply to it :slight_smile:

Sounds like you should start unit testing :slight_smile:

2 Likes