]> granicus.if.org Git - php/commitdiff
Update array access syntax deprecated
authorAlex Porto dos Santos <31667409+alexporto2200@users.noreply.github.com>
Thu, 17 Oct 2019 18:39:22 +0000 (15:39 -0300)
committerChristoph M. Becker <cmbecker69@gmx.de>
Thu, 17 Oct 2019 21:39:55 +0000 (23:39 +0200)
Update array access syntax deprecated in line 175 and 204
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/alex/php/hello/ext_skel.php on line 175
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/alex/php/hello/ext_skel.php on line 204

ext/ext_skel.php

index ea8df0ac7df3a8a7c70e8fbb91725b0c64f5785b..5f45ed5146c717a5c7cbedc3a32f00cc07e5cd87 100755 (executable)
@@ -174,7 +174,7 @@ function process_args($argv, $argc) {
        {
                $val = $argv[$i];
 
-               if($val{0} != '-' || $val{1} != '-')
+               if($val[0] != '-' || $val[1] != '-')
                {
                        continue;
                }
@@ -203,7 +203,7 @@ function process_args($argv, $argc) {
                        case 'ext':
                        case 'dir':
                        case 'author': {
-                               if (!isset($argv[$i + 1]) || ($argv[$i + 1]{0} == '-' && $argv[$i + 1]{1} == '-')) {
+                               if (!isset($argv[$i + 1]) || ($argv[$i + 1][0] == '-' && $argv[$i + 1][1] == '-')) {
                                        error('Argument "' . $val . '" expects a value, none passed');
                                } else if ($opt == 'dir' && empty($argv[$i + 1])) {
                                        continue 2;