summaryrefslogtreecommitdiffstats
path: root/97.patch
blob: e88ab79ceddba5e49339a4098dea6f25e2a80788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
From d87bedbb147d726689a6b83c31648c08af35b3be Mon Sep 17 00:00:00 2001
From: Jack Cherng <jfcherng@gmail.com>
Date: Wed, 7 Aug 2019 07:51:33 +0800
Subject: [PATCH 1/2] Fix PHP 7.4 deprecation: array/string curly braces access

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
---
 OS/Guess.php                      |  2 +-
 PEAR/Builder.php                  |  2 +-
 PEAR/Command.php                  |  2 +-
 PEAR/Command/Config.php           |  4 ++--
 PEAR/Common.php                   |  4 ++--
 PEAR/Config.php                   |  2 +-
 PEAR/DependencyDB.php             |  2 +-
 PEAR/Downloader.php               |  2 +-
 PEAR/Installer/Role.php           |  2 +-
 PEAR/PackageFile.php              | 12 ++++++------
 PEAR/PackageFile/Generator/v1.php |  6 +++---
 PEAR/PackageFile/Generator/v2.php |  2 +-
 PEAR/PackageFile/v1.php           |  4 ++--
 PEAR/PackageFile/v2/Validator.php | 12 ++++++------
 PEAR/Registry.php                 |  6 +++---
 PEAR/Start.php                    |  2 +-
 PEAR/Start/CLI.php                |  2 +-
 PEAR/Validate.php                 |  6 +++---
 System.php                        |  2 +-
 19 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/OS/Guess.php b/OS/Guess.php
index 79d5cfe36..d5aa295c3 100644
--- a/OS/Guess.php
+++ b/OS/Guess.php
@@ -253,7 +253,7 @@ function _detectGlibcVersion()
             fclose($fp);
             $cpp = popen("/usr/bin/cpp $tmpfile", "r");
             while ($line = fgets($cpp, 1024)) {
-                if ($line{0} == '#' || trim($line) == '') {
+                if ($line[0] == '#' || trim($line) == '') {
                     continue;
                 }
 
diff --git a/PEAR/Builder.php b/PEAR/Builder.php
index 807a8520b..2c51a8e4f 100644
--- a/PEAR/Builder.php
+++ b/PEAR/Builder.php
@@ -191,7 +191,7 @@ function _harvestInstDir($dest_prefix, $dirname, &$built_files)
 
         $ret = true;
         while (($ent = readdir($d)) !== false) {
-            if ($ent{0} == '.')
+            if ($ent[0] == '.')
                 continue;
 
             $full = $dirname . DIRECTORY_SEPARATOR . $ent;
diff --git a/PEAR/Command.php b/PEAR/Command.php
index eb9543906..77d722bf7 100644
--- a/PEAR/Command.php
+++ b/PEAR/Command.php
@@ -233,7 +233,7 @@ public static function registerCommands($merge = false, $dir = null)
         }
 
         while ($file = readdir($dp)) {
-            if ($file{0} == '.' || substr($file, -4) != '.xml') {
+            if ($file[0] == '.' || substr($file, -4) != '.xml') {
                 continue;
             }
 
diff --git a/PEAR/Command/Config.php b/PEAR/Command/Config.php
index f3174aef3..01d12eed0 100644
--- a/PEAR/Command/Config.php
+++ b/PEAR/Command/Config.php
@@ -315,7 +315,7 @@ function doConfigCreate($command, $options, $params)
         $root = preg_replace(array('!\\\\+!', '!/+!', "!$ds2+!"),
                              array('/', '/', '/'),
                             $root);
-        if ($root{0} != '/') {
+        if ($root[0] != '/') {
             if (!isset($options['windows'])) {
                 return PEAR::raiseError('Root directory must be an absolute path beginning ' .
                     'with "/", was: "' . $root . '"');
@@ -338,7 +338,7 @@ function doConfigCreate($command, $options, $params)
 
         $params[1] = realpath($params[1]);
         $config = new PEAR_Config($params[1], '#no#system#config#', false, false);
-        if ($root{strlen($root) - 1} == '/') {
+        if ($root[strlen($root) - 1] == '/') {
             $root = substr($root, 0, strlen($root) - 1);
         }
 
diff --git a/PEAR/Common.php b/PEAR/Common.php
index c15591a98..11a325d98 100644
--- a/PEAR/Common.php
+++ b/PEAR/Common.php
@@ -686,7 +686,7 @@ function buildProvidesArray($srcinfo)
             foreach ($methods as $method) {
                 $function = "$class::$method";
                 $key = "function;$function";
-                if ($method{0} == '_' || !strcasecmp($method, $class) ||
+                if ($method[0] == '_' || !strcasecmp($method, $class) ||
                     isset($this->pkginfo['provides'][$key])) {
                     continue;
                 }
@@ -698,7 +698,7 @@ function buildProvidesArray($srcinfo)
 
         foreach ($srcinfo['declared_functions'] as $function) {
             $key = "function;$function";
-            if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) {
+            if ($function[0] == '_' || isset($this->pkginfo['provides'][$key])) {
                 continue;
             }
 
diff --git a/PEAR/Config.php b/PEAR/Config.php
index 0d02c4ce4..ea4c320eb 100644
--- a/PEAR/Config.php
+++ b/PEAR/Config.php
@@ -2092,7 +2092,7 @@ static function _prependPath($path, $prepend)
             if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) {
                 if (preg_match('/^[a-z]:/i', $prepend)) {
                     $prepend = substr($prepend, 2);
-                } elseif ($prepend{0} != '\\') {
+                } elseif ($prepend[0] != '\\') {
                     $prepend = "\\$prepend";
                 }
                 $path = substr($path, 0, 2) . $prepend . substr($path, 2);
diff --git a/PEAR/DependencyDB.php b/PEAR/DependencyDB.php
index 4f633ff1f..319074b05 100644
--- a/PEAR/DependencyDB.php
+++ b/PEAR/DependencyDB.php
@@ -174,7 +174,7 @@ function assertDepsDB()
             $this->rebuildDB();
         }
 
-        if ($depdb['_version']{0} > $this->_version{0}) {
+        if ($depdb['_version']{0} > $this->_version[0]) {
             return PEAR::raiseError('Dependency database is version ' .
                 $depdb['_version'] . ', and we are version ' .
                 $this->_version . ', cannot continue');
diff --git a/PEAR/Downloader.php b/PEAR/Downloader.php
index b1427c430..6996d3d9a 100644
--- a/PEAR/Downloader.php
+++ b/PEAR/Downloader.php
@@ -1156,7 +1156,7 @@ function _prependPath($path, $prepend)
             if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) {
                 if (preg_match('/^[a-z]:/i', $prepend)) {
                     $prepend = substr($prepend, 2);
-                } elseif ($prepend{0} != '\\') {
+                } elseif ($prepend[0] != '\\') {
                     $prepend = "\\$prepend";
                 }
                 $path = substr($path, 0, 2) . $prepend . substr($path, 2);
diff --git a/PEAR/Installer/Role.php b/PEAR/Installer/Role.php
index 7bed4eaea..ce30d8f79 100644
--- a/PEAR/Installer/Role.php
+++ b/PEAR/Installer/Role.php
@@ -237,7 +237,7 @@ public static function registerRoles($dir = null)
         }
 
         while ($entry = readdir($dp)) {
-            if ($entry{0} == '.' || substr($entry, -4) != '.xml') {
+            if ($entry[0] == '.' || substr($entry, -4) != '.xml') {
                 continue;
             }
 
diff --git a/PEAR/PackageFile.php b/PEAR/PackageFile.php
index b1252ae0b..e483337c5 100644
--- a/PEAR/PackageFile.php
+++ b/PEAR/PackageFile.php
@@ -94,13 +94,13 @@ function setLogger(&$l)
      */
     function &parserFactory($version)
     {
-        if (!in_array($version{0}, array('1', '2'))) {
+        if (!in_array($version[0], array('1', '2'))) {
             $a = false;
             return $a;
         }
 
-        include_once 'PEAR/PackageFile/Parser/v' . $version{0} . '.php';
-        $version = $version{0};
+        include_once 'PEAR/PackageFile/Parser/v' . $version[0] . '.php';
+        $version = $version[0];
         $class = "PEAR_PackageFile_Parser_v$version";
         $a = new $class;
         return $a;
@@ -122,13 +122,13 @@ function getClassPrefix()
      */
     function &factory($version)
     {
-        if (!in_array($version{0}, array('1', '2'))) {
+        if (!in_array($version[0], array('1', '2'))) {
             $a = false;
             return $a;
         }
 
-        include_once 'PEAR/PackageFile/v' . $version{0} . '.php';
-        $version = $version{0};
+        include_once 'PEAR/PackageFile/v' . $version[0] . '.php';
+        $version = $version[0];
         $class = $this->getClassPrefix() . $version;
         $a = new $class;
         return $a;
diff --git a/PEAR/PackageFile/Generator/v1.php b/PEAR/PackageFile/Generator/v1.php
index 739a83470..db882cf40 100644
--- a/PEAR/PackageFile/Generator/v1.php
+++ b/PEAR/PackageFile/Generator/v1.php
@@ -904,7 +904,7 @@ function _convertRelease2_0(&$release, $package)
                 if (isset($package['install-as'][$file])) {
                     continue;
                 }
-                if ($platform{0} != '!') {
+                if ($platform[0] != '!') {
                     //o <ignore> tags for <file name=... platform=...>
                     $genericIgnore[] = $file;
                 }
@@ -913,7 +913,7 @@ function _convertRelease2_0(&$release, $package)
                 $oses = $notplatform = $platform = array();
                 foreach ($package['platform'] as $file => $os) {
                     // get a list of oses
-                    if ($os{0} == '!') {
+                    if ($os[0] == '!') {
                         if (isset($oses[substr($os, 1)])) {
                             continue;
                         }
@@ -1010,7 +1010,7 @@ function _convertRelease2_0(&$release, $package)
                             continue;
                         }
                         //o <ignore> tags for <file name=... platform=other platform>
-                        if ($platform{0} != '!' && $platform != $os) {
+                        if ($platform[0] != '!' && $platform != $os) {
                             $release[$releaseNum]['filelist']['ignore'][] =
                                 array(
                                     'attribs' => array(
diff --git a/PEAR/PackageFile/Generator/v2.php b/PEAR/PackageFile/Generator/v2.php
index 53555010e..9e535792a 100644
--- a/PEAR/PackageFile/Generator/v2.php
+++ b/PEAR/PackageFile/Generator/v2.php
@@ -781,7 +781,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array())
                     }
                 }
 
-                if (is_string($value) && $value && ($value{strlen($value) - 1} == "\n")) {
+                if (is_string($value) && $value && ($value[strlen($value) - 1] == "\n")) {
                     $value .= str_repeat($this->options['indent'], $this->_tagDepth);
                 }
                 $tmp .= $this->_createXMLTag(array(
diff --git a/PEAR/PackageFile/v1.php b/PEAR/PackageFile/v1.php
index 711f43b1b..69cb3a6c6 100644
--- a/PEAR/PackageFile/v1.php
+++ b/PEAR/PackageFile/v1.php
@@ -1575,7 +1575,7 @@ function _buildProvidesArray($srcinfo)
             foreach ($methods as $method) {
                 $function = "$class::$method";
                 $key = "function;$function";
-                if ($method{0} == '_' || !strcasecmp($method, $class) ||
+                if ($method[0] == '_' || !strcasecmp($method, $class) ||
                     isset($this->_packageInfo['provides'][$key])) {
                     continue;
                 }
@@ -1586,7 +1586,7 @@ function _buildProvidesArray($srcinfo)
 
         foreach ($srcinfo['declared_functions'] as $function) {
             $key = "function;$function";
-            if ($function{0} == '_' || isset($this->_packageInfo['provides'][$key])) {
+            if ($function[0] == '_' || isset($this->_packageInfo['provides'][$key])) {
                 continue;
             }
             if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) {
diff --git a/PEAR/PackageFile/v2/Validator.php b/PEAR/PackageFile/v2/Validator.php
index e26dab368..06109b641 100644
--- a/PEAR/PackageFile/v2/Validator.php
+++ b/PEAR/PackageFile/v2/Validator.php
@@ -419,7 +419,7 @@ function _processAttribs($choice, $tag, $context)
             foreach ($tags as $i => $tag) {
                 if (!is_array($tag) || !isset($tag['attribs'])) {
                     foreach ($choice['attribs'] as $attrib) {
-                        if ($attrib{0} != '?') {
+                        if ($attrib[0] != '?') {
                             $ret &= $this->_tagHasNoAttribs($choice['tag'],
                                 $context);
                             continue 2;
@@ -427,7 +427,7 @@ function _processAttribs($choice, $tag, $context)
                     }
                 }
                 foreach ($choice['attribs'] as $attrib) {
-                    if ($attrib{0} != '?') {
+                    if ($attrib[0] != '?') {
                         if (!isset($tag['attribs'][$attrib])) {
                             $ret &= $this->_tagMissingAttribute($choice['tag'],
                                 $attrib, $context);
@@ -450,9 +450,9 @@ function _processStructure($key)
             }
             return $ret;
         }
-        $multi = $key{0};
+        $multi = $key[0];
         if ($multi == '+' || $multi == '*') {
-            $ret['multiple'] = $key{0};
+            $ret['multiple'] = $key[0];
             $key = substr($key, 1);
         }
         if (count($attrs = explode('->', $key)) > 1) {
@@ -2106,7 +2106,7 @@ function _buildProvidesArray($srcinfo)
             foreach ($methods as $method) {
                 $function = "$class::$method";
                 $key = "function;$function";
-                if ($method{0} == '_' || !strcasecmp($method, $class) ||
+                if ($method[0] == '_' || !strcasecmp($method, $class) ||
                     isset($providesret[$key])) {
                     continue;
                 }
@@ -2118,7 +2118,7 @@ function _buildProvidesArray($srcinfo)
 
         foreach ($srcinfo['declared_functions'] as $function) {
             $key = "function;$function";
-            if ($function{0} == '_' || isset($providesret[$key])) {
+            if ($function[0] == '_' || isset($providesret[$key])) {
                 continue;
             }
 
diff --git a/PEAR/Registry.php b/PEAR/Registry.php
index 08987c615..61b756eb8 100644
--- a/PEAR/Registry.php
+++ b/PEAR/Registry.php
@@ -1187,7 +1187,7 @@ function _listChannels()
 
         $dp = opendir($this->channelsdir);
         while ($ent = readdir($dp)) {
-            if ($ent{0} == '.' || substr($ent, -4) != '.reg') {
+            if ($ent[0] == '.' || substr($ent, -4) != '.reg') {
                 continue;
             }
 
@@ -1238,7 +1238,7 @@ function _listPackages($channel = false)
         }
 
         while ($ent = readdir($dp)) {
-            if ($ent{0} == '.' || substr($ent, -4) != '.reg') {
+            if ($ent[0] == '.' || substr($ent, -4) != '.reg') {
                 continue;
             }
 
@@ -1262,7 +1262,7 @@ function _listChannelPackages($channel)
         }
 
         while ($ent = readdir($dp)) {
-            if ($ent{0} == '.' || substr($ent, -4) != '.reg') {
+            if ($ent[0] == '.' || substr($ent, -4) != '.reg') {
                 continue;
             }
             $pkglist[] = substr($ent, 0, -4);
diff --git a/PEAR/Validate.php b/PEAR/Validate.php
index 9aa89a2ca..134fe17a3 100644
--- a/PEAR/Validate.php
+++ b/PEAR/Validate.php
@@ -209,7 +209,7 @@ function validatePackageName()
                 }
                 $vlen = strlen($test);
                 $majver = substr($name, strlen($name) - $vlen);
-                while ($majver && !is_numeric($majver{0})) {
+                while ($majver && !is_numeric($majver[0])) {
                     $majver = substr($majver, 1);
                 }
                 if ($majver != $test) {
@@ -328,7 +328,7 @@ function validateVersion()
                 } else {
                     $vlen = strlen($versioncomponents[0] . '');
                     $majver = substr($name, strlen($name) - $vlen);
-                    while ($majver && !is_numeric($majver{0})) {
+                    while ($majver && !is_numeric($majver[0])) {
                         $majver = substr($majver, 1);
                     }
                     if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) {
@@ -398,7 +398,7 @@ function validateVersion()
                 if ($this->_packagexml->getExtends()) {
                     $vlen = strlen($versioncomponents[0] . '');
                     $majver = substr($name, strlen($name) - $vlen);
-                    while ($majver && !is_numeric($majver{0})) {
+                    while ($majver && !is_numeric($majver[0])) {
                         $majver = substr($majver, 1);
                     }
                     if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) {
diff --git a/System.php b/System.php
index aefc85b3f..d5b6a147d 100644
--- a/System.php
+++ b/System.php
@@ -74,7 +74,7 @@ public static function _parseArgs($argv, $short_options, $long_options = null)
             $offset = 0;
             foreach ($av as $a) {
                 $b = trim($a[0]);
-                if ($b{0} == '"' || $b{0} == "'") {
+                if ($b[0] == '"' || $b[0] == "'") {
                     continue;
                 }
 

From 49af2f4cae6f2910fbca31febea12c7617fa7377 Mon Sep 17 00:00:00 2001
From: Jack Cherng <jfcherng@gmail.com>
Date: Wed, 4 Sep 2019 17:41:04 +0800
Subject: [PATCH 2/2] Fix PHP 7.4 deprecation: array/string curly braces access

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
---
 PEAR/Command/Channels.php         | 2 +-
 PEAR/Command/Common.php           | 2 +-
 PEAR/DependencyDB.php             | 2 +-
 PEAR/Installer.php                | 2 +-
 PEAR/PackageFile/Generator/v1.php | 8 ++++----
 PEAR/PackageFile/v2/Validator.php | 4 ++--
 PEAR/Registry.php                 | 2 +-
 PEAR/Validate.php                 | 4 ++--
 System.php                        | 2 +-
 make-gopear-phar.php              | 2 +-
 make-installpear-nozlib-phar.php  | 2 +-
 make-pear-bundle.php              | 4 ++--
 12 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/PEAR/Command/Channels.php b/PEAR/Command/Channels.php
index 0319593dd..1253eab5d 100644
--- a/PEAR/Command/Channels.php
+++ b/PEAR/Command/Channels.php
@@ -673,7 +673,7 @@ function doAlias($command, $options, $params)
             return $this->raiseError('No channel alias specified');
         }
 
-        if (count($params) !== 2 || (!empty($params[1]) && $params[1]{0} == '-')) {
+        if (count($params) !== 2 || (!empty($params[1]) && $params[1][0] == '-')) {
             return $this->raiseError(
                 'Invalid format, correct is: channel-alias channel alias');
         }
diff --git a/PEAR/Command/Common.php b/PEAR/Command/Common.php
index a9bc80ff2..365c64eb2 100644
--- a/PEAR/Command/Common.php
+++ b/PEAR/Command/Common.php
@@ -146,7 +146,7 @@ function getGetoptArgs($command, &$short_args, &$long_args)
         foreach ($this->commands[$command]['options'] as $option => $info) {
             $larg = $sarg = '';
             if (isset($info['arg'])) {
-                if ($info['arg']{0} == '(') {
+                if ($info['arg'][0] == '(') {
                     $larg = '==';
                     $sarg = '::';
                     $arg = substr($info['arg'], 1, -1);
diff --git a/PEAR/DependencyDB.php b/PEAR/DependencyDB.php
index 319074b05..5ad831667 100644
--- a/PEAR/DependencyDB.php
+++ b/PEAR/DependencyDB.php
@@ -174,7 +174,7 @@ function assertDepsDB()
             $this->rebuildDB();
         }
 
-        if ($depdb['_version']{0} > $this->_version[0]) {
+        if ($depdb['_version'][0] > $this->_version[0]) {
             return PEAR::raiseError('Dependency database is version ' .
                 $depdb['_version'] . ', and we are version ' .
                 $this->_version . ', cannot continue');
diff --git a/PEAR/Installer.php b/PEAR/Installer.php
index 5c503852e..ed3c6ea46 100644
--- a/PEAR/Installer.php
+++ b/PEAR/Installer.php
@@ -225,7 +225,7 @@ function _installFile($file, $atts, $tmp_path, $options)
                 $os = new OS_Guess();
             }
 
-            if (strlen($atts['platform']) && $atts['platform']{0} == '!') {
+            if (strlen($atts['platform']) && $atts['platform'][0] == '!') {
                 $negate   = true;
                 $platform = substr($atts['platform'], 1);
             } else {
diff --git a/PEAR/PackageFile/Generator/v1.php b/PEAR/PackageFile/Generator/v1.php
index db882cf40..8c0fa452b 100644
--- a/PEAR/PackageFile/Generator/v1.php
+++ b/PEAR/PackageFile/Generator/v1.php
@@ -889,13 +889,13 @@ function _convertRelease2_0(&$release, $package)
                 }
                 //o <install as=..> tags for <file name=... platform=!... install-as=..>
                 if (isset($package['platform'][$file]) &&
-                      $package['platform'][$file]{0} == '!') {
+                      $package['platform'][$file][0] == '!') {
                     $generic[] = $file;
                     continue;
                 }
                 //o <ignore> tags for <file name=... platform=... install-as=..>
                 if (isset($package['platform'][$file]) &&
-                      $package['platform'][$file]{0} != '!') {
+                      $package['platform'][$file][0] != '!') {
                     $genericIgnore[] = $file;
                     continue;
                 }
@@ -959,7 +959,7 @@ function _convertRelease2_0(&$release, $package)
                         //  <file name=... platform=!other platform install-as=..>
                         if (isset($package['platform'][$file]) &&
                               $package['platform'][$file] != "!$os" &&
-                              $package['platform'][$file]{0} == '!') {
+                              $package['platform'][$file][0] == '!') {
                             $release[$releaseNum]['filelist']['install'][] =
                                 array(
                                     'attribs' => array(
@@ -984,7 +984,7 @@ function _convertRelease2_0(&$release, $package)
                         //o <ignore> tags for
                         //  <file name=... platform=other platform install-as=..>
                         if (isset($package['platform'][$file]) &&
-                              $package['platform'][$file]{0} != '!' &&
+                              $package['platform'][$file][0] != '!' &&
                               $package['platform'][$file] != $os) {
                             $release[$releaseNum]['filelist']['ignore'][] =
                                 array(
diff --git a/PEAR/PackageFile/v2/Validator.php b/PEAR/PackageFile/v2/Validator.php
index 06109b641..506230838 100644
--- a/PEAR/PackageFile/v2/Validator.php
+++ b/PEAR/PackageFile/v2/Validator.php
@@ -1080,8 +1080,8 @@ function _validateFilelist($list = false, $allowignore = false, $dirs = '')
             foreach ($list['file'] as $i => $file)
             {
                 if (isset($file['attribs']) && isset($file['attribs']['name'])) {
-                    if ($file['attribs']['name']{0} == '.' &&
-                          $file['attribs']['name']{1} == '/') {
+                    if ($file['attribs']['name'][0] == '.' &&
+                          $file['attribs']['name'][1] == '/') {
                         // name is something like "./doc/whatever.txt"
                         $this->_invalidFileName($file['attribs']['name'], $dirname);
                     }
diff --git a/PEAR/Registry.php b/PEAR/Registry.php
index 61b756eb8..d97bbc076 100644
--- a/PEAR/Registry.php
+++ b/PEAR/Registry.php
@@ -2204,7 +2204,7 @@ function parsePackageName($param, $defaultchannel = 'pear.php.net')
             }
             if (!isset($components['scheme'])) {
                 if (strpos($components['path'], '/') !== false) {
-                    if ($components['path']{0} == '/') {
+                    if ($components['path'][0] == '/') {
                         return PEAR::raiseError('parsePackageName(): this is not ' .
                             'a package name, it begins with "/" in "' . $param . '"',
                             'invalid', null, null, $param);
diff --git a/PEAR/Validate.php b/PEAR/Validate.php
index 134fe17a3..683fd52db 100644
--- a/PEAR/Validate.php
+++ b/PEAR/Validate.php
@@ -287,7 +287,7 @@ function validateVersion()
                 }
                 if (!$this->_packagexml->getExtends()) {
                     if ($versioncomponents[0] == '1') {
-                        if ($versioncomponents[2]{0} == '0') {
+                        if ($versioncomponents[2][0] == '0') {
                             if ($versioncomponents[2] == '0') {
                                 // version 1.*.0000
                                 $this->_addWarning('version',
@@ -339,7 +339,7 @@ function validateVersion()
                         return true;
                     }
                     if ($versioncomponents[0] == $majver) {
-                        if ($versioncomponents[2]{0} == '0') {
+                        if ($versioncomponents[2][0] == '0') {
                             if ($versioncomponents[2] == '0') {
                                 // version 2.*.0000
                                 $this->_addWarning('version',
diff --git a/System.php b/System.php
index d5b6a147d..338fe1d82 100644
--- a/System.php
+++ b/System.php
@@ -265,7 +265,7 @@ public static function mkDir($args)
             } elseif ($opt[0] == 'm') {
                 // if the mode is clearly an octal number (starts with 0)
                 // convert it to decimal
-                if (strlen($opt[1]) && $opt[1]{0} == '0') {
+                if (strlen($opt[1]) && $opt[1][0] == '0') {
                     $opt[1] = octdec($opt[1]);
                 } else {
                     // convert to int