3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Fundbay\Deals; use Illuminate\Support\ServiceProvider; class DealServiceProvider extends ServiceProvider { /** * @return void */ public function boot() { $this->bootObservers(); $this->bootViewComposers(); $this->registerPayloadEvents(); } /** * @return void */ public function registerPayloadEvents() { $this->app['events']->listen('dashboard.payload', 'Fundbay\Deals\Services\PayloadBuilder'); } /** * @return void */ protected function bootObservers() { Models\EloquentDealModel::observe(new Observers\DealStatusObserver($this->app['Fundbay\Authentication\Services\PermissionService'])); Models\EloquentAssetImageModel::observe(new Observers\ImageResizeObserver($this->app['queue'])); Models\EloquentMessageModel::observe($this->app->make('Fundbay\Deals\Observers\MessageMailerObserver')); Models\EloquentEvidenceRequestModel::observe($this->app->make('Fundbay\Deals\Observers\EvidenceRequestMailerObserver')); Models\EloquentOfferModel::observe($this->app->make('Fundbay\Deals\Observers\OfferMailerObserver')); Models\EloquentOfferModel::observe(new Observers\OfferStatusObserver($this->app['Fundbay\Authentication\Services\PermissionService'])); } /** * @return void */ protected function bootViewComposers() { /** @var \Illuminate\View\Factory $view */ $view = $this->app['view']; $view->composer('deals.partials.show', 'Fundbay\Deals\Composers\DealIndexShowComposer'); $view->composer('emails.deals.deal', 'Fundbay\Deals\Composers\DealIndexShowComposer'); $view->composer('deals.show', 'Fundbay\Deals\Composers\DealShowComposer'); $view->composer('deals.partials.details', 'Fundbay\Deals\Composers\DealShowDetailsComposer'); $view->composer('offers.partials.embed-item', 'Fundbay\Deals\Composers\OfferEmbedItemComposer'); } /** * Register the service provider. * * @return void */ public function register() { $this->registerRepositories(); $this->registerFormBuilders(); $this->registerServices(); $this->registerCommands(); } /** * @return void */ protected function registerRepositories() { $this->app->bind('Fundbay\Deals\Repositories\DealRepositoryInterface', function() { return new Repositories\EloquentDealRepository(new Models\EloquentDealModel, new Validators\DealValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\ContactRepositoryInterface', function() { return new Repositories\EloquentContactRepository(new Models\EloquentContactModel, new Validators\ContactValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\AssetRepositoryInterface', function() { return new Repositories\EloquentAssetRepository(new Models\EloquentAssetModel, new Validators\AssetValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\LoanRepositoryInterface', function() { return new Repositories\EloquentLoanRepository(new Models\EloquentLoanModel, new Validators\LoanValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\LoanPurposeRepositoryInterface', function() { return new Repositories\EloquentLoanPurposeRepository(new Models\EloquentLoanPurposeModel, new Validators\LoanPurposeValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\AssetOptionRepositoryInterface', function() { return new Repositories\EloquentAssetOptionRepository(new Models\EloquentAssetOptionModel, new Validators\AssetOptionValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\AssetImageRepositoryInterface', function() { return new Repositories\EloquentAssetImageRepository(new Models\EloquentAssetImageModel, new Validators\AssetImageValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\OfferRepositoryInterface', function() { return new Repositories\EloquentOfferRepository(new Models\EloquentOfferModel, new Validators\OfferValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\MessageRepositoryInterface', function() { return new Repositories\EloquentMessageRepository(new Models\EloquentMessageModel, new Validators\MessageValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\EvidenceRequirementRepositoryInterface', function() { return new Repositories\EloquentEvidenceRequirementRepository(new Models\EloquentEvidenceRequirementModel, new Validators\EvidenceRequirementValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\EvidenceRequiredRepositoryInterface', function() { return new Repositories\EloquentEvidenceRequiredRepository(new Models\EloquentEvidenceRequiredModel, new Validators\EvidenceRequiredValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\EvidenceRequiredFileRepositoryInterface', function() { return new Repositories\EloquentEvidenceRequiredFileRepository(new Models\EloquentEvidenceRequiredFileModel, new Validators\EvidenceRequiredFileValidator($this->app['validator'])); }); $this->app->bind('Fundbay\Deals\Repositories\EvidenceRequestRepositoryInterface', function() { return new Repositories\EloquentEvidenceRequestRepository(new Models\EloquentEvidenceRequestModel, new Validators\EvidenceRequestValidator($this->app['validator'])); }); } /** * @return void */ protected function registerServices() { Services\OfferService::setMinimum($this->app['config']->get('deals.offers.minimum')); $this->app->bindShared('Fundbay\Deals\Services\ImageResizeService', function() { $storage = $this->app->make('Fundbay\Deals\Services\AssetImages\StorageInterface'); return new Services\ImageResizeService($storage, $this->app['image'], $this->app['config']['images.sizes']); }); $this->app->bindShared('Fundbay\Deals\Services\AssetImages\StorageInterface', function() { $driver = $this->app['config']['images.driver']; $method = 'getAssetImageStorageDriver' . ucfirst($driver); $config = $this->app['config']['images.drivers'][$driver]; return $this->{$method}($config); }); $this->app->bind('Fundbay\Deals\Services\EvidenceFileManager', function() { return new Services\EvidenceFileManager( $this->app->make('Fundbay\Deals\Repositories\EvidenceRequiredFileRepositoryInterface'), $this->app->make('Fundbay\Deals\Repositories\EvidenceRequirementRepositoryInterface'), $this->app['path.evidence-requirements'] ); }); } /** * @return void */ protected function registerFormBuilders() { $form = new Html\FormMacros($this->app); $this->app->booted(function() use ($form) { $form->setAssetOptionRepository($this->app->make('Fundbay\Deals\Repositories\AssetOptionRepositoryInterface')); $this->app['form']->macro('assetOptions', [$form, 'assetOptions']); }); } /** * @param array $config * @return \Fundbay\Deals\Services\AssetImages\FilesystemStorage */ protected function getAssetImageStorageDriverFiles(array $config) { $instance = new Services\AssetImages\FilesystemStorage($this->app['files']); foreach ($config['folders'] as $name => $data) { if ('~' === $data['dir'][0]) { $data['dir'] = $this->app['path.base'] . substr($data['dir'], 1); } if ('~' === $data['uri'][0]) { $data['uri'] = $this->app['config']['app.url'] . substr($data['uri'], 1); } $instance->addSize($name, $data['dir'], $data['uri']); } return $instance; } /** * Register commands. */ protected function registerCommands() { $this->app['commands.deals.digest'] = function() { return $this->app->make(Commands\LenderDigestCommand::class); }; $this->commands('commands.deals.digest'); } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0090.00918.43
8.3.50.0090.00922.91
8.3.40.0030.01318.98
8.3.30.0090.00919.05
8.3.20.0050.00320.24
8.3.10.0030.00621.89
8.3.00.0040.00419.17
8.2.180.0100.01016.63
8.2.170.0110.00422.96
8.2.160.0040.01820.60
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0030.00520.82
8.2.110.0060.00321.07
8.2.100.0040.00817.97
8.2.90.0000.00819.57
8.2.80.0030.00618.34
8.2.70.0050.00318.18
8.2.60.0040.00417.75
8.2.50.0050.00318.34
8.2.40.0040.00420.58
8.2.30.0030.00622.43
8.2.20.0050.00317.89
8.2.10.0040.00418.04
8.2.00.0040.00417.71
8.1.280.0060.00925.92
8.1.270.0040.00418.82
8.1.260.0080.00026.35
8.1.250.0020.00528.09
8.1.240.0030.00722.42
8.1.230.0040.00922.63
8.1.220.0040.00417.74
8.1.210.0030.00618.79
8.1.200.0060.00317.47
8.1.190.0030.00617.36
8.1.180.0050.00318.10
8.1.170.0080.00018.69
8.1.160.0040.00418.96
8.1.150.0040.00420.29
8.1.140.0000.00717.48
8.1.130.0000.00717.73
8.1.120.0040.00417.50
8.1.110.0080.00017.40
8.1.100.0050.00317.47
8.1.90.0050.00317.49
8.1.80.0000.00817.49
8.1.70.0070.00017.34
8.1.60.0030.00917.66
8.1.50.0000.00817.50
8.1.40.0090.00017.36
8.1.30.0040.00417.68
8.1.20.0030.00517.51
8.1.10.0050.00317.65
8.1.00.0040.00417.57
8.0.300.0040.00420.02
8.0.290.0060.00317.00
8.0.280.0090.00018.54
8.0.270.0040.00417.46
8.0.260.0030.00317.40
8.0.250.0070.00017.11
8.0.240.0060.00317.14
8.0.230.0060.00317.10
8.0.220.0030.00317.05
8.0.210.0030.00317.08
8.0.200.0070.00017.16
8.0.190.0000.00817.11
8.0.180.0040.00417.09
8.0.170.0000.00817.12
8.0.160.0000.00716.98
8.0.150.0040.00416.89
8.0.140.0070.00016.94
8.0.130.0000.00613.52
8.0.120.0030.00616.93
8.0.110.0000.00817.08
8.0.100.0040.00417.05
8.0.90.0040.00416.95
8.0.80.0080.00917.09
8.0.70.0030.00616.96
8.0.60.0050.00216.92
8.0.50.0040.00417.04
8.0.30.0060.01517.23
8.0.20.0090.01417.40
8.0.10.0000.00817.10
8.0.00.0160.00816.87
7.4.330.0000.00615.03
7.4.320.0000.00616.70
7.4.300.0000.00716.65
7.4.290.0070.00016.45
7.4.280.0080.00016.62
7.4.270.0030.00316.45
7.4.260.0040.00416.39
7.4.250.0050.00216.61
7.4.240.0020.00516.59
7.4.230.0050.00316.75
7.4.220.0100.00616.54
7.4.210.0120.00916.50
7.4.200.0030.00316.52
7.4.160.0100.00616.46
7.4.150.0140.00417.40
7.4.140.0130.00917.86
7.4.130.0130.00516.66
7.4.120.0050.01316.61
7.4.110.0130.01016.47
7.4.100.0070.01116.68
7.4.90.0060.01016.45
7.4.80.0100.00719.39
7.4.70.0030.01416.74
7.4.60.0140.00416.51
7.4.50.0040.00416.43
7.4.40.0100.01016.38
7.4.30.0090.00916.43
7.4.00.0040.01415.02
7.3.330.0060.00313.26
7.3.320.0050.00013.39
7.3.310.0040.00416.20
7.3.300.0000.00716.25
7.3.290.0100.00616.39
7.3.280.0090.00816.41
7.3.270.0110.01117.40
7.3.260.0130.01316.49
7.3.250.0110.01016.53
7.3.240.0100.01316.63
7.3.230.0120.00616.45
7.3.210.0090.00916.39
7.3.200.0100.01019.39
7.3.190.0170.00616.40
7.3.180.0100.00716.72
7.3.170.0080.00816.39
7.3.160.0090.00616.46
7.3.120.0030.01414.96
7.3.110.0080.01014.91
7.3.100.0040.01114.90
7.3.90.0100.00215.00
7.3.80.0050.00714.96
7.3.70.0010.01315.02
7.3.60.0060.00414.93
7.3.50.0020.01114.95
7.3.40.0080.00714.80
7.3.30.0060.00514.92
7.3.20.0030.01216.52
7.3.10.0030.00816.56
7.3.00.0030.00816.46
7.2.330.0110.00716.51
7.2.320.0160.00616.38
7.2.310.0090.00916.49
7.2.300.0090.00916.64
7.2.290.0090.00916.62
7.2.250.0100.00914.89
7.2.240.0050.01514.83
7.2.230.0070.00914.73
7.2.220.0060.00515.03
7.2.210.0070.00714.88
7.2.200.0060.00714.93
7.2.190.0090.00214.96
7.2.180.0030.00915.01
7.2.170.0040.01114.83
7.2.00.0000.01219.29
7.1.330.0060.00715.70
7.1.320.0050.00615.51
7.1.310.0060.00515.63
7.1.300.0030.00715.71
7.1.290.0050.00715.55
7.1.280.0070.00715.57
7.1.270.0000.01215.24
7.1.260.0100.00115.56
7.1.100.0000.01318.07
7.1.70.0030.00716.98
7.1.60.0000.01117.09
7.1.50.0030.01916.88
7.1.00.0100.07022.44
7.0.200.0070.01016.64
7.0.140.0000.03722.02
7.0.100.0000.07720.02
7.0.90.0070.09320.16
7.0.80.0130.07320.01
7.0.70.0130.08320.04
7.0.60.0000.08020.06
7.0.50.0270.07720.29
7.0.40.0030.07020.11
7.0.30.0070.08720.11
7.0.20.0100.07720.11
7.0.10.0000.07320.11
7.0.00.0100.07719.99
5.6.280.0030.07321.01
5.6.250.0130.06720.81
5.6.240.0130.06720.71
5.6.230.0000.05020.83
5.6.220.0100.08020.73
5.6.210.0130.08020.86
5.6.200.0200.06321.27
5.6.190.0030.08721.13
5.6.180.0130.07721.13
5.6.170.0100.06021.03
5.6.160.0030.09021.16
5.6.150.0130.08321.23
5.6.140.0070.08721.04
5.6.130.0100.08721.10
5.6.120.0070.08321.18
5.6.110.0030.09021.04
5.6.100.0070.08321.07
5.6.90.0070.08721.10
5.6.80.0070.08020.45
5.6.70.0100.04720.49
5.6.60.0100.05020.57
5.6.50.0070.07020.61
5.6.40.0070.05720.56
5.6.30.0130.07320.55
5.6.20.0130.06320.50
5.6.10.0130.07020.49
5.6.00.0000.04020.44
5.5.380.0130.07020.42
5.5.370.0070.09020.46
5.5.360.0130.06720.48
5.5.350.0000.08720.54
5.5.340.0100.07721.03
5.5.330.0030.08720.86
5.5.320.0130.07320.97
5.5.310.0100.08020.90
5.5.300.0130.07720.88
5.5.290.0170.07020.73
5.5.280.0070.08721.01
5.5.270.0030.08720.98
5.5.260.0030.08720.86
5.5.250.0030.08020.83
5.5.240.0100.05320.34
5.5.230.0070.08320.26
5.5.220.0030.07720.29
5.5.210.0100.07020.20
5.5.200.0170.06720.24
5.5.190.0030.04020.32
5.5.180.0030.04720.09
5.5.160.0200.06320.20
5.5.150.0070.05720.32
5.5.140.0130.08020.21
5.5.130.0030.07720.26
5.5.120.0000.04720.37
5.5.110.0030.07020.34
5.5.100.0030.07720.17
5.5.90.0130.07320.18
5.5.80.0070.03320.25
5.5.70.0070.07720.03
5.5.60.0100.05020.15
5.5.50.0130.04020.24
5.5.40.0170.06720.15
5.5.30.0100.07020.22
5.5.20.0070.08020.02
5.5.10.0070.05720.06
5.5.00.0100.03720.18
5.4.450.0000.07319.54
5.4.440.0170.05719.56
5.4.430.0100.07019.52
5.4.420.0230.06319.45
5.4.410.0070.07719.07
5.4.400.0070.06019.24
5.4.390.0070.06718.97
5.4.380.0100.07718.88
5.4.370.0070.07319.20
5.4.360.0130.07018.97
5.4.350.0000.06719.16
5.4.340.0000.08019.20
5.4.320.0000.06719.20
5.4.310.0170.06318.91
5.4.300.0070.07019.09
5.4.290.0100.05319.09
5.4.280.0130.04719.13
5.4.270.0030.03719.23
5.4.260.0130.07018.89
5.4.250.0100.06718.91
5.4.240.0000.07019.16
5.4.230.0100.07318.97
5.4.220.0100.03719.13
5.4.210.0130.05718.87
5.4.200.0100.05719.20
5.4.190.0030.07319.23
5.4.180.0100.07718.90
5.4.170.0070.07719.22
5.4.160.0030.07319.12
5.4.150.0070.06319.02
5.4.140.0100.04016.53
5.4.130.0070.04716.42
5.4.120.0070.07016.49
5.4.110.0130.07016.45
5.4.100.0070.06716.43
5.4.90.0100.06316.43
5.4.80.0030.04716.43
5.4.70.0030.07316.38
5.4.60.0070.04716.38
5.4.50.0100.06016.55
5.4.40.0000.04316.37
5.4.30.0030.03716.54
5.4.20.0030.04316.39
5.4.10.0100.06316.48
5.4.00.0030.05715.83

preferences:
61.65 ms | 401 KiB | 5 Q