diff --git a/classes/phing/lib/Capsule.php b/classes/phing/lib/Capsule.php index 951089405f..028d65023b 100644 --- a/classes/phing/lib/Capsule.php +++ b/classes/phing/lib/Capsule.php @@ -200,9 +200,9 @@ public function parse($template, $outputFile = null, $append = false) */ protected function resolvePath($file, $basepath) { - if (!($file{0} == DIRECTORY_SEPARATOR || $file{0} == '/') + if (!($file[0] == DIRECTORY_SEPARATOR || $file[0] == '/') // also account for C:\ style path - && !($file{1} == ':' && ($file{2} == DIRECTORY_SEPARATOR || $file{2} == '/')) + && !($file[1] == ':' && ($file[2] == DIRECTORY_SEPARATOR || $file[2] == '/')) ) { if ($basepath != null) { $file = $basepath . DIRECTORY_SEPARATOR . $file; diff --git a/classes/phing/tasks/system/Basename.php b/classes/phing/tasks/system/Basename.php index c96657cf75..a6d1bd9e43 100644 --- a/classes/phing/tasks/system/Basename.php +++ b/classes/phing/tasks/system/Basename.php @@ -93,7 +93,7 @@ public function main() // char preceding the suffix is a '.', we assume the user // wants to remove the '.' as well $pos = strlen($value) - strlen($this->suffix) - 1; - if ($pos > 0 && $this->suffix{0} !== '.' && $value{$pos} === '.') { + if ($pos > 0 && $this->suffix[0] !== '.' && $value[$pos] === '.') { $pos--; } $value = StringHelper::substring($value, 0, $pos); diff --git a/classes/phing/tasks/system/CvsPassTask.php b/classes/phing/tasks/system/CvsPassTask.php index d3d7f45113..acc543878f 100644 --- a/classes/phing/tasks/system/CvsPassTask.php +++ b/classes/phing/tasks/system/CvsPassTask.php @@ -391,7 +391,7 @@ final private function mangle($password) { $buf = ""; for ($i = 0, $plen = strlen($password); $i < $plen; $i++) { - $buf .= chr(self::$shifts[ord($password{$i})]); + $buf .= chr(self::$shifts[ord($password[$i])]); } return $buf; diff --git a/classes/phing/tasks/system/PropertyTask.php b/classes/phing/tasks/system/PropertyTask.php index e25b4d62e5..ea23c174b9 100644 --- a/classes/phing/tasks/system/PropertyTask.php +++ b/classes/phing/tasks/system/PropertyTask.php @@ -552,7 +552,7 @@ protected function parsePropertyString($value, &$fragments, &$propertyRefs) if ($pos === (strlen($value) - 1)) { array_push($fragments, '$'); $prev = $pos + 1; - } elseif ($value{$pos + 1} !== '{') { + } elseif ($value[$pos + 1] !== '{') { // the string positions were changed to value-1 to correct // a fatal error coming from function substring() diff --git a/classes/phing/util/StringHelper.php b/classes/phing/util/StringHelper.php index bd70394beb..d30add1ce6 100644 --- a/classes/phing/util/StringHelper.php +++ b/classes/phing/util/StringHelper.php @@ -79,7 +79,7 @@ public static function unqualify($qualifiedName, $separator = '.') /** * Converts a string to an indexed array of chars * There's really no reason for this to be used in PHP, since strings - * are all accessible using the $string{0} notation. + * are all accessible using the $string[0] notation. * * @param string $str * diff --git a/test/classes/phing/BuildFileTest.php b/test/classes/phing/BuildFileTest.php index 1ab0600ab2..1e72de338f 100644 --- a/test/classes/phing/BuildFileTest.php +++ b/test/classes/phing/BuildFileTest.php @@ -182,7 +182,7 @@ private function cleanBuffer($buffer) $cleanedBuffer = ""; $cr = false; for ($i = 0, $bufflen = strlen($buffer); $i < $bufflen; $i++) { - $ch = $buffer{$i}; + $ch = $buffer[$i]; if ($ch == "\r") { $cr = true; continue;