3v4l.org

run code in 300+ PHP versions simultaneously
<?php import { Injectable, OnDestroy } from "@angular/core"; import { CreditAnalysisService } from "../credit-analysis.service"; import { ProgressTimelineService } from "@sw/shared/progress-timeline/progress-timeline.service"; import { BehaviorSubject } from "rxjs"; import { TemplateEnum } from "@sw/credit-review/enums/template-enum"; declare let $: any; declare let bootstrap: any; @Injectable() export class CASectionService implements OnDestroy { creditAnalysisData: any; sequenceCreditAnalysisData: any; enableDragndDrop: boolean = false; enableSimultaneous: boolean = false; constructor( private creditAnalysisService: CreditAnalysisService, private timelineStatusService: ProgressTimelineService ) {} private sectionDataChange = new BehaviorSubject<any>(null); private templateId: number; sectionData$ = this.sectionDataChange.asObservable(); setTemplateId(id: number) { this.templateId = id; } addSectionToCreditAnalysis(section: any) { if (!this.creditAnalysisData) { this.creditAnalysisData = []; } const existingIndex = this.creditAnalysisData.findIndex( item => item.parameterId === section.parameterId ); if (existingIndex === -1) { this.creditAnalysisData.push(section); this.creditAnalysisData.sort( (a, b) => (a.data?.sequence || a.sequence) - (b.data?.sequence || b.sequence) ); this.sequenceCreditAnalysisData = [...this.creditAnalysisData]; this.updateSectionData(section); } } updateSectionData(sectionData: any) { this.sectionDataChange.next(sectionData); } generateCAObject(data): any { if (this.creditAnalysisData && this.creditAnalysisData.length > 0) { const mergedSections = [...this.creditAnalysisData]; data?.forEach(newSection => { if ( !mergedSections.some( existing => existing.parameterId === newSection.parameterId ) ) { if (this.shouldIncludeSection(newSection)) { mergedSections.push(newSection); } } }); this.creditAnalysisData = mergedSections; } else { if ( this.templateId === TemplateEnum.Rbar || this.templateId === TemplateEnum.Standard ) { this.creditAnalysisData = data?.filter( obj => obj.isMandatory === true || obj.checked || obj.isSaved || obj.isDefaultView === true ); } else { this.creditAnalysisData = data?.filter( obj => obj.isMandatory === true || obj.checked || obj.isSaved ); } } this.sequenceCreditAnalysisData = this.creditAnalysisData; return this.creditAnalysisData; } private shouldIncludeSection(section: any): boolean { if ( this.templateId === TemplateEnum.Rbar || this.templateId === TemplateEnum.Standard ) { return ( section.isMandatory === true || section.checked === true || section.isSaved === true || section.isDefaultView === true ); } else { return ( section.isMandatory === true || section.checked === true || section.isSaved === true ); } } enableActionBox(data): any { for (const item of this.creditAnalysisData) { if (item.parameterId === data.parameterId && !item.isOpen) { item.isActionbox = true; item.isOpen = true; if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = false; } } else { item.isActionbox = false; item.isOpen = false; } } return this.creditAnalysisData; } onEditAction(data): any { this.enableSimultaneous = false; let result; for (const obj of this.creditAnalysisData) { if (obj.parameterName === data.parameterName) { obj.isRTE = true; result = data.data.editorData; if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = false; } } } return result; } onSaveAction(data, isSimultaneous?: boolean): any { if (data.data !== "" && data.data !== undefined) { this.timelineStatusService.updateStatus( data.parameterName, data.data?.editorData && data.data?.editorData !== "" ); for (const obj of this.creditAnalysisData) { if (obj.parameterName === data.parameterName) { obj.sectionDescription = data.data?.editorData; if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = true; } obj.isRTE = false; if (isSimultaneous) { } else { this.collapseAll(); } } } } } collapseAll() { $(".collapse").collapse("hide"); for (const obj of this.creditAnalysisData) { obj.isActionbox = false; obj.isOpen = false; } if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = true; } } ngOnDestroy(): void { this.enableDragndDrop = false; } }

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.5.00.0210.00817.18
8.4.150.0340.00719.68
8.4.140.0350.00817.77
8.4.130.0340.00817.79
8.4.120.0360.01117.89
8.4.110.0350.01018.00
8.4.100.0380.00617.86
8.4.90.0390.00618.01
8.4.80.0390.00617.80
8.4.70.0350.00917.56
8.4.60.0380.00917.89
8.4.50.0350.00917.95
8.4.40.0370.01117.71
8.4.30.0400.00917.61
8.4.20.0410.00917.44
8.4.10.0430.00517.70
8.3.280.0310.01017.98
8.3.270.0400.00717.18
8.3.260.0370.00717.18
8.3.250.0320.01117.18
8.3.240.0380.00517.18
8.3.230.0420.00317.18
8.3.220.0360.00717.18
8.3.210.0370.00717.18
8.3.200.0330.01017.18
8.3.190.0390.00417.18
8.3.180.0370.00717.18
8.3.170.0390.00617.18
8.3.160.0410.00917.18
8.3.150.0370.00717.18
8.3.140.0350.01017.18
8.3.130.0310.00917.18
8.3.120.0310.01117.18
8.3.110.0330.00817.18
8.3.100.0340.01117.18
8.3.90.0370.00917.18
8.3.80.0360.00917.18
8.3.70.0400.01117.18
8.3.60.0360.01017.18
8.3.50.0340.01017.18
8.3.40.0360.01017.57
8.3.30.0270.00817.85
8.3.20.0260.00817.77
8.3.10.0270.00817.97
8.3.00.0170.00717.92
8.2.290.0310.00417.18
8.2.280.0270.00817.18
8.2.270.0310.00717.18
8.2.260.0280.00917.18
8.2.250.0340.00717.18
8.2.240.0310.00817.18
8.2.230.0300.01017.18
8.2.220.0290.00917.18
8.2.210.0310.00717.18
8.2.200.0290.00917.18
8.2.190.0320.00617.18
8.2.180.0330.00717.18
8.2.170.0250.01118.06
8.2.160.0310.00617.91
8.2.150.0290.00717.73
8.2.140.0300.00717.61
8.2.130.0350.00517.62
8.2.120.0300.00617.59
8.2.110.0290.00717.83
8.2.100.0260.00917.89
8.2.90.0300.00617.75
8.2.80.0230.01317.82
8.2.70.0290.00717.77
8.2.60.0290.00617.57
8.2.50.0270.01117.53
8.2.40.0320.00417.83
8.2.30.0230.01317.57
8.2.20.0270.01017.64
8.2.10.0370.00617.71
8.2.00.0340.00717.60

preferences:
148.61 ms | 1011 KiB | 7 Q