3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(): Closure { $b = new B(); return function() use ($b) { $b->bar(); }; } } ?> <?php use Biz\ImportedException; class B { public function bar() { throw new ImportedException(); } } ?> <?php namespace Biz; use \Exception; class ImportedException extends Exception { } ?> <?php $a = new A(); $closure = $a->foo(); $closure(); ?>

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.2.60.1550.01214.66
7.2.50.1800.00614.67
7.2.40.1620.00814.89
7.2.30.1130.00914.94
7.2.20.1080.00814.87
7.2.10.1780.00614.90
7.2.00.1460.00715.08
7.1.170.1480.00913.43
7.1.160.1150.01116.33
7.1.150.1440.01516.44
7.1.140.1530.01116.45
7.1.130.1410.01316.30
7.1.120.1390.00916.49
7.1.110.1760.00916.08
7.1.100.2410.00816.05
7.1.90.1660.00915.91
7.1.80.1470.01315.75
7.1.70.1410.00915.04
7.1.60.1590.01433.14
7.1.50.1560.01532.91
7.1.40.1590.01032.36
7.1.30.1620.01432.54
7.1.20.1630.01432.70
7.1.10.1420.01014.61
7.1.00.1620.00814.87

preferences:
138.9 ms | 1398 KiB | 7 Q