3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ToolSetFactory { public function createGeneral(): General; public function createArrows(): Arrows; public function createFlowchart(): Flowchart; public function createUML(): UML; public function createEntityRelation(): EntityRelation; public function createMisc(): Misc; } class BasicToolSetFactory implements ToolSetFactory { public function createGeneral(): General { return new GeneralProduct(); } public function createArrows(): Arrows { return new ArrowsProduct(); } public function createFlowchart(): Flowchart { return new NullFlowchartProduct(); } public function createUML(): UML { return new NullUMLProduct(); } public function createEntityRelation(): EntityRelation { return new NullEntityRelationProduct(); } public function createMisc(): Misc { return new MiscProduct(); } } // Interfaces interface Drawable { public function draw(): void; } interface General extends Drawable {} interface Arrows extends Drawable {} interface Flowchart extends Drawable {} interface UML extends Drawable {} interface EntityRelation extends Drawable {} interface Misc extends Drawable {} // Products class GeneralProduct implements General { public function draw(): void { print "Drawing general elements\n"; } // Other methods } class ArrowsProduct implements Arrows { public function draw(): void { print "Drawing arrows elements\n"; } // Other methods } class MiscProduct implements Misc { public function draw(): void { print "Drawing misc elements\n"; } // Other methods } class NullFlowchartProduct implements Flowchart { public function draw(): void { print ''; } // Other methods } class NullUMLProduct implements UML { public function draw(): void { print ''; } // Other methods } class NullEntityRelationProduct implements EntityRelation { public function draw(): void { print ''; } // Other methods } // Client code class BasicToolSet { public function createToolSet(ToolSetFactory $factory) { $general = $factory->createGeneral(); $arrows = $factory->createArrows(); $misc = $factory->createMisc(); foreach ([ $general, $arrows, $misc ] as $product) { $product->draw(); } } // other stuff } // Usage $basicToolSetFactory = new BasicToolSetFactory(); $basicToolSet = new BasicToolSet(); $basicToolSet->createToolSet($basicToolSetFactory);

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.120.0080.00019.22
8.3.110.0040.00420.94
8.3.100.0080.00824.06
8.3.90.0070.00426.77
8.3.80.0030.00618.18
8.3.70.0120.00316.63
8.3.60.0130.00918.31
8.3.50.0070.00718.40
8.3.40.0090.00920.52
8.3.30.0110.00718.71
8.3.20.0040.00424.18
8.3.10.0030.00524.66
8.3.00.0040.00426.16
8.2.240.0060.00317.20
8.2.230.0070.00322.58
8.2.220.0040.00437.54
8.2.210.0080.00026.77
8.2.200.0070.00316.75
8.2.190.0040.01116.75
8.2.180.0070.01016.63
8.2.170.0140.00719.04
8.2.160.0070.00722.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00726.16
8.2.110.0050.00521.94
8.2.100.0090.00020.52
8.2.20.0060.00417.66
8.1.300.0040.01116.14
8.1.290.0030.00730.84
8.1.280.0110.00425.92
8.1.270.0080.00624.66
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0060.00318.36
8.1.230.0000.01118.48

preferences:
42.84 ms | 403 KiB | 5 Q