3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Product { private string $title; private string $description; private int $price; private string $currency; private string $category; private string $brand; private array $options; /** * @return string */ public function getTitle(): string { return $this->title; } /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @return string */ public function getDescription(): string { return $this->description; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @return int */ public function getPrice(): int { return $this->price; } /** * @param int $price */ public function setPrice(int $price): void { $this->price = $price; } /** * @return string */ public function getCurrency(): string { return $this->currency; } /** * @param string $currency */ public function setCurrency(string $currency): void { $this->currency = $currency; } /** * @return string */ public function getCategory(): string { return $this->category; } /** * @param string $category */ public function setCategory(string $category): void { $this->category = $category; } /** * @return string */ public function getBrand(): string { return $this->brand; } /** * @param string $brand */ public function setBrand(string $brand): void { $this->brand = $brand; } /** * @return array */ public function getOptions(): array { return $this->options; } /** * @param array $options */ public function setOptions(array $options): void { $this->options = $options; } } class Option { private string $title; private string $description; private int $price; private array $items; /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @param int $price */ public function setPrice(int $price): void { $this->price = $price; } /** * @param array $items */ public function setItems(array $items): void { $this->items = $items; } } class OptionItem { private string $title; private string $description; private int $price; /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @param int $price */ public function setPrice(int $price): void { $this->price = $price; } } $products = []; for ($k = 0; $k <= 100; $k++) { $product = new Product(); $product->setTitle('Product' . $k); $product->setDescription('Product ' . $k . ' Description'); $product->setPrice(random_int(1000, 10000)); $product->setCurrency('USD'); $product->setCategory('Category' . $k); $product->setBrand('Brand' . $k); $options = []; for ($j = 0; $j <= 10; $j++) { $option = new Option(); $option->setTitle('Option' . $j); $option->setDescription('Option ' . $j . ' Description'); $option->setPrice(random_int(1000, 10000)); $optionItems = []; for ($i = 0; $i <= 100; $i++) { $optionItem = new OptionItem(); $optionItem->setTitle('Option Item' . $i); $optionItem->setDescription('Option Item ' . $i . ' Description'); $optionItem->setPrice(random_int(1000, 10000)); $optionItems[] = $optionItem; } $option->setItems($optionItems); $options[] = $option; } $product->setOptions($options); $products[] = $product; }

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.4.10.0980.03642.83
8.3.140.0740.06541.43
8.3.130.0820.05141.68
8.3.120.0780.06241.92
8.3.110.0770.05741.27
8.3.100.0850.05941.30
8.3.90.0910.04741.38
8.3.80.0830.05041.17
8.3.70.0720.05341.49
8.3.60.0950.03541.47
8.3.50.1060.04441.93
8.3.40.0900.04242.47
8.3.30.0700.04542.91
8.3.20.0780.04142.68
8.3.10.0720.04542.85
8.3.00.0660.04642.74
8.2.260.0960.04841.65
8.2.250.0860.03641.82
8.2.240.0840.03041.86
8.2.230.0890.02842.00
8.2.220.0770.04641.61
8.2.210.0910.05242.02
8.2.200.0920.05041.89
8.2.190.0820.03242.13
8.2.180.0890.04041.77
8.2.170.0900.03242.86
8.2.160.0720.04442.80
8.2.150.1100.05242.38
8.2.140.1090.04342.43
8.2.130.0750.04542.48
8.2.120.0630.05742.48
8.2.110.0890.03142.66
8.2.100.0770.04542.64
8.2.90.1120.06142.42
8.2.80.1010.04942.63
8.2.70.1050.04142.46
8.2.60.0940.02542.36
8.2.50.0950.02542.37
8.2.40.0530.06342.95
8.2.30.0570.06143.00
8.2.20.0890.03142.76
8.2.10.1040.04342.62
8.2.00.0800.06642.77

preferences:
28.42 ms | 403 KiB | 5 Q