Framework: ErrorException: Illegal offset type in isset or empty in new version

Created on 16 Jun 2020  路  17Comments  路  Source: laravel/framework


  • Laravel Version: v7.16.0
  • PHP Version: PHP 7.4.7
  • Database Driver & Version: Homestead, mariadb

Description:

After updating to v7.16.0 I am getting these errors (was working in v7.15.0). On CLI and on the web version.

ErrorException: Illegal offset type in isset or empty

/test/vendor/laravel/framework/src/Illuminate/Container/Container.php:1159
/test/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:779
/test/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:415
/test/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:396
/test/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:226
/test/vendor/laravel/framework/src/Illuminate/Database/Connection.php:835
/test/vendor/laravel/framework/src/Illuminate/Database/Connection.php:689
/test/vendor/laravel/framework/src/Illuminate/Database/Connection.php:642
/test/vendor/laravel/framework/src/Illuminate/Database/Connection.php:339
/test/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2203
/test/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2191
/test/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2686
/test/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2192
/test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:539
/test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:523
/test/app/Models/Category.php:233
/test/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:383
/test/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:383
/test/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
/test/app/Models/Category.php:235
/test/app/Providers/ComposerServiceProvider.php:24
/test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:33
/test/vendor/laravel/framework/src/Illuminate/Container/Util.php:37
/test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:91
/test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35
/test/vendor/laravel/framework/src/Illuminate/Container/Container.php:592
/test/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:867
/test/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:850
/test/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:851
/test/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17
/test/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:230
/test/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:310
/test/tests/CreatesApplication.php:18
/test/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:102
/test/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:81

Schermafbeelding 2020-06-16 om 15 57 05

Steps To Reproduce:

Update an existing Laravel v7.15.0 to v7.16.0

needs more info

Most helpful comment

Fixed in 7.16.1

All 17 comments

Can you please post some code because otherwise there's not much for us to check into.

Yeah I dont know, all my Laravel apps on v7 have this problem on the latest Laravel.

Post your model and test please.

Illegal offset type in isset or empty

at vendor/laravel/framework/src/Illuminate/Container/Container.php:1159
1155| * @return string
1156| */
1157| public function getAlias($abstract)
1158| {

1159| if (! isset($this->aliases[$abstract])) {
1160| return $abstract;
1161| }
1162|
1163| return $this->getAlias($this->aliases[$abstract]);

  +10 vendor frames

11 app/Exceptions/Handler.php:49
Illuminate\Foundation\Exceptions\Handler::report(Object(ErrorException))

I have the same problem

This error is appearing for me as well. Will expand this post with more information when I have it.

EDIT: At the moment appears when attempting to migrate:fresh --seed and attempting login. Non auth views seem to load.

getting it just with a simple artisan execution

Please don't post "also experiencing this" comments, thanks. We know the bug is present and are looking into it atm.

Please help us with code samples. We can't reproduce this ourselves atm.

Please don't post "also experiencing this" comments, thanks. We know the bug is present and are looking into it atm.

as of yet i saw nothing in this feed that recognized it as a bug, it only had the label "needs more info". You're asking to post a model and test. All I'm trying to do was to mention that you don't need to do much more than do a simple execution of the artisan command to get the error.

@cognetif Nope. I can migrate fine. So, it's not that simple obviously.

We got this to after upgrading to 7.16.0. It's due to the commit handle array callbacks in the event listener: https://github.com/laravel/framework/commit/b80ddf458bd08de375d83b716a1309ed927197aa

Will check if i can provide a reproducible sample.

We got this to after upgrading to 7.16.0. It's due to the commit handle array callbacks in the event listener: b80ddf4

Flare share: https://flareapp.io/share/4m4M8JPM#F13

Will check if i can provide a reproducible sample.

It works again after reverting these changes

understood... looks like for me its the sentry/sentry-laravel package thats the issue.

I've faced the same problem after upgrading. I've had to downgrade.

php artisan migrate
ErrorException
Illegal offset type in isset or empty
at vendor/laravel/framework/src/Illuminate/Container/Container.php:1159
1155| * @return string
1156| */
1157| public function getAlias($abstract)
1158| {

1159| if (! isset($this->aliases[$abstract])) {
1160| return $abstract;
1161| }
1163| return $this->getAlias($this->aliases[$abstract]);

11 app/Exceptions/Handler.php:39
Illuminate\Foundation\Exceptions\Handler::report(Object(ErrorException))
14 [internal]:0 Illuminate\Foundation\Bootstrap\HandleExceptions::handleException(Object(ErrorException))

I was in an emergency. I downgraded to 7.15 and it works.

Downgrading laravel/framework (v7.16.0 => v7.15.0)

Fixed in 7.16.1

Was this page helpful?
0 / 5 - 0 ratings