3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Session { private $data; function __construct() { session_id() or session_start(); if (!isset($_SESSION['test'])) $_SESSION['test'] = array(); $this->data = &$_SESSION['test']; } function set($key, $value) { $this->data[$key] = $value; }; function get($Key) { return $this->data[$key]; }; } $s = new Session(); $s->set('foo', 'coins'); $s->set('ix', 'janz23'); var_dump($_SESSION);

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)
5.4.270.0220.04115.72
5.4.260.0230.04615.88
5.4.250.0240.04015.76
5.4.240.0190.04215.61
5.4.230.0100.05015.82
5.4.220.0210.04315.84
5.4.210.0260.03915.83
5.4.200.0180.04515.84
5.4.190.0190.04315.69
5.4.180.0200.04215.63
5.4.170.0190.05015.67
5.4.160.0150.04815.71
5.4.150.0170.05215.82
5.4.140.0200.04314.31
5.4.130.0220.03914.22
5.4.120.0170.04314.20
5.4.110.0190.04314.27
5.4.100.0160.04614.31
5.4.90.0180.04514.13
5.4.80.0170.04514.09
5.4.70.0170.04514.32
5.4.60.0180.04314.30
5.4.50.0230.04114.31
5.4.40.0170.04314.28
5.4.30.0190.04114.07
5.4.20.0150.04514.24
5.4.10.0250.04314.27
5.4.00.0250.04113.63
5.3.280.0220.04213.65
5.3.270.0170.04813.63
5.3.260.0200.04613.67
5.3.250.0240.04013.71
5.3.240.0190.04413.78
5.3.230.0260.03713.61
5.3.220.0220.04213.56
5.3.210.0210.04213.58
5.3.200.0160.05013.58
5.3.190.0200.04513.57
5.3.180.0160.04413.64
5.3.170.0210.04313.58
5.3.160.0130.04513.70
5.3.150.0160.05213.61
5.3.140.0210.03813.61
5.3.130.0250.04413.56
5.3.120.0200.04513.54
5.3.110.0150.04913.56
5.3.100.0180.04813.10
5.3.90.0140.05213.07
5.3.80.0180.04313.05
5.3.70.0160.04813.00
5.3.60.0160.04512.99
5.3.50.0230.03913.00
5.3.40.0170.05012.98
5.3.30.0150.04713.04
5.3.20.0180.04212.74
5.3.10.0200.04112.63
5.3.00.0210.05212.62

preferences:
136.81 ms | 1394 KiB | 7 Q