PHP

PHP

Made by DeepSource

Invalid use of increment/decrement operators PHP-E1006

Bug risk
Major

This issue is raised when increment/decrement operators are used on any other type of variable than numbers or strings.

// Bad practice
$object = new stdClass;
$object++;

$date = date('j. n. Y')++;

$array = [1, 2, 3];
$array++;

// Recommended
$i = 1;
$i++;

$text = 'abc';
$text++;

References