1.2.1064. Self-Transforming Variables

Variables that are assigned to themselves, after transformation. Auto-transformations include appending element to an array, using post and pre increment operators, and assigning to the variable the result of a call where the variable is also an argument.

<?php

$s = strtolower($s);

// filtering one element AND dropping all that not 1
$a = array_filter('foo', $a[1]);

$o->m = foo($o->m);

?>

1.2.1064.1. Suggestions

  • Use new variables to hold transformed values.

1.2.1064.2. Specs

Short name

Variables/SelfTransform

Rulesets

All, CE, Changed Behavior

Exakat since

1.7.0

PHP Version

All

Severity

Time To Fix

Precision

High

Available in

Entreprise Edition, Community Edition, Exakat Cloud