3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface iCrud { public function create($data); public function read(); public function update($data); public function delete(); } class User implements iCrud { private $_userId = NULL; private $_username = NULL; function __construct($data) { $this->_userId = uniqid(); $this->_username = $data['username']; } function create($data) { self::__construct($data); } function read() { return array('userId' => $this->_userId, 'username' => $this->_username); } function update($data) { $this->_username = $data['username']; } public function delete() { $this->_username = NULL; $this->_userId = NULL; } } // assignment $u = new User(['username' => 'potato']); $u->create(['username' => 'notPotato']); var_dump($u);

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.10.0130.00315.05
7.4.00.0050.01414.85
7.3.130.0070.00715.05
7.3.120.0090.00714.66
7.3.110.0080.01114.81
7.3.100.0070.00914.74
7.3.90.0050.01114.95
7.3.80.0070.00515.04
7.3.70.0050.00914.86
7.3.60.0090.00614.85
7.3.50.0060.00414.81
7.3.40.0070.00614.65
7.3.30.0080.00914.69
7.3.20.3070.00715.91
7.3.10.3710.00515.89
7.3.00.2750.00616.07
7.2.260.0030.01514.92
7.2.250.0080.00614.97
7.2.240.0090.00915.00
7.2.230.0110.00515.07
7.2.220.0050.01114.67
7.2.210.0030.01015.10
7.2.200.0060.00915.12
7.2.190.0050.00714.99
7.2.180.0070.01014.94
7.2.170.0050.00814.99
7.2.160.0070.01114.90
7.2.150.7740.00515.90
7.2.140.4060.01015.85
7.2.130.0350.00515.68
7.2.120.0270.00915.90
7.2.110.0140.00615.93
7.2.100.0140.00615.70
7.2.90.2480.00915.98
7.2.80.0620.01015.81
7.2.70.0630.00815.89
7.2.60.0110.00515.83
7.2.50.0920.01015.96
7.2.40.0180.00815.75
7.2.30.0210.01115.90
7.2.20.0130.00515.72
7.2.10.0120.00815.89
7.2.00.0170.01315.74
7.1.330.0080.00615.78
7.1.320.0030.00915.83
7.1.310.0030.01115.64
7.1.300.0100.00315.72
7.1.290.0050.00615.78
7.1.280.0040.00915.76
7.1.270.0210.00915.02
7.1.260.1620.01015.07
7.1.250.0230.00614.75
7.1.240.0070.00715.70
7.1.230.0040.00715.50
7.1.220.0070.00715.70
7.1.210.0030.01015.60
7.1.200.0060.00915.77
7.1.190.0100.00315.77
7.1.180.0030.01015.66
7.1.170.0040.01215.71
7.1.160.0110.00615.93
7.1.150.0090.00015.70
7.1.140.0030.01015.56
7.1.130.0000.01115.52
7.1.120.0100.00715.64
7.1.110.0110.00315.86
7.1.100.0030.00715.87
7.1.90.0030.01015.64
7.1.80.0060.00615.90
7.1.70.0060.00615.61
7.1.60.0060.01015.82
7.1.50.0000.01415.76
7.1.40.0090.00015.91
7.1.30.0030.01015.78
7.1.20.0030.01015.76
7.1.10.0100.00615.73
7.1.00.0090.00015.83

preferences:
31.74 ms | 401 KiB | 5 Q