8000 bug #32806 [Console] fix warning on PHP 7.4 (rez1dent3) · symfony/symfony@3f43186 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f43186

Browse files
bug #32806 [Console] fix warning on PHP 7.4 (rez1dent3)
This PR was submitted for the 4.3 branch but it was squashed and merged into the 3.4 branch instead (closes #32806). Discussion ---------- [Console] fix warning on PHP 7.4 | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT In php 7.4rc, accessing an array by key, sometimes causes an error. Rarely this error occurs on php 7.2. ```bash ErrorException: Trying to access array offset on value of type int /app/vendor/symfony/console/Input/ArrayInput.php:135 /app/vendor/symfony/console/Input/Input.php:55 /app/vendor/symfony/console/Application.php:208 /app/vendor/symfony/console/Application.php:149 /app/vendor/laravel/framework/src/Illuminate/Console/Application.php:90 /app/vendor/laravel/framework/src/Illuminate/Console/Application.php:182 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:275 /app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/PendingCommand.php:136 /app/vendor/orchestra/testbench-core/src/Database/MigrateProcessor.php:73 /app/vendor/orchestra/testbench-core/src/Database/MigrateProcessor.php:44 /app/vendor/orchestra/testbench-core/src/Concerns/WithLoadMigrationsFrom.php:27 ``` Commits ------- 5f451e6 [Console] fix warning on PHP 7.4
2 parents 5c67a67 + 5f451e6 commit 3f43186

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Input/ArrayInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected function parse()
132132
}
133133
if (0 === strpos($key, '--')) {
134134
$this->addLongOption(substr($key, 2), $value);
135-
} elseif ('-' === $key[0]) {
135+
} elseif (0 === strpos($key, '-')) {
136136
$this->addShortOption(substr($key, 1), $value);
137137
} else {
138138
$this->addArgument($key, $value);

0 commit comments

Comments
 (0)
0