3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Faker { class Factory { public static function create(string $lang) { return new class() { public $name = 'someName'; }; } } } namespace { function index() { $faker = Faker\Factory::create('fr_FR'); $ideas = []; $ideas = []; for($i = rand(10, 50); $i > 0; $i--) { $ideas[] = new class($ideas, $faker) { private $id; private $author; function __construct($ideas, $faker) { $this->id = count($ideas) + 1; $this->author = $faker->name; } }; } var_dump($ideas); echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; } index(); }

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)
7.4.80.0030.01816.45
7.4.70.0150.00616.12
7.4.60.0110.00916.45
7.4.50.0210.00316.25
7.4.40.0150.00616.40
7.4.30.0030.02416.47
7.4.20.0120.01216.71
7.4.10.0210.00016.30
7.4.00.0070.01416.42
7.3.200.0060.01816.31
7.3.190.0210.00516.31
7.3.180.0130.00716.32
7.3.170.0170.00616.37
7.3.160.0100.00916.61
7.3.150.0060.01516.49
7.3.140.0200.00016.27
7.3.130.0150.00916.42
7.3.120.0110.00816.30
7.3.110.0070.01316.27
7.3.100.0140.00416.46
7.3.90.0090.01216.46
7.3.80.0090.01216.52
7.3.70.0180.00716.48
7.3.60.0140.00616.25
7.3.50.0130.00616.42
7.3.40.0100.00916.35
7.3.30.0130.00916.46
7.3.20.0090.01516.41
7.3.10.0140.00716.37
7.3.00.0110.00916.30
7.2.320.0030.01916.68
7.2.310.0120.01216.64
7.2.300.0080.01616.55
7.2.290.0160.00516.77
7.2.280.0140.00716.55
7.2.270.0100.01116.56
7.2.260.0110.00916.82
7.2.250.0100.01416.80
7.2.240.0000.01916.64
7.2.230.0070.01516.88
7.2.220.0030.01616.70
7.2.210.0140.00716.70
7.2.200.0080.01316.72
7.2.190.0120.00916.55
7.2.180.0140.01016.62
7.2.170.0100.01016.71
7.2.160.0160.00316.58
7.2.150.0130.01316.68
7.2.140.0180.01116.86
7.2.130.0140.00816.81
7.2.120.0100.01716.78
7.2.110.0130.01016.66
7.2.100.0070.01516.78
7.2.90.0060.01616.77
7.2.80.0120.01216.73
7.2.70.0120.00816.48
7.2.60.0100.01416.64
7.2.50.0210.00716.57
7.2.40.0070.01516.77
7.2.30.0170.01116.64
7.2.20.0150.00916.59
7.2.10.0170.00416.64
7.2.00.0060.01616.61

preferences:
58.57 ms | 403 KiB | 5 Q