for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EddIriarte\Console\Inputs\Exceptions;
class IndexOutOfRange extends \Exception
{
public function __construct(string $index)
parent::__construct("Index \"$index\" does not exists.");
sprintf
$index
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.
// Instead of $x = "foo $bar $baz"; // Better use either $x = "foo " . $bar . " " . $baz; $x = sprintf("foo %s %s", $bar, $baz);
}