3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new StdClass; $obj->fn = function($arg) { return "Hello $arg"; }; echo ($obj->fn)('World'); class Bla { public $fn; } $bla = new Bla; $bla->fn = function($arg="Bu"){return "Hello lo $arg"; } // can't do in class! echo ($bla->fn)('Wa');

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.0.20.0330.06320.07
7.0.10.0100.04720.16
7.0.00.0000.09020.22
5.6.170.0200.04020.40
5.6.160.0130.05020.61
5.6.150.0030.04018.15
5.6.140.0070.08018.15
5.6.130.0070.04718.23
5.6.120.0170.07721.20
5.6.110.0070.08020.99
5.6.100.0170.07320.97
5.6.90.0100.06021.00
5.6.80.0070.08320.41
5.5.310.0200.08320.51
5.5.300.0070.08017.98
5.5.290.0030.05018.02
5.5.280.0100.05320.85
5.5.270.0170.07720.82
5.5.260.0130.09320.77
5.5.250.0100.07720.50
5.5.240.4230.03720.27

preferences:
137.39 ms | 1394 KiB | 7 Q