3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cookie{ public $username; public $coffee; public $token; public function __toString() { return "<p> Hey ".$this->username."! </p><br>" . "<p> Here is your token for a free ". $this->coffee."!!</p><p>".$this->token."</p><p>Give us this token at your next visit!</p>"; } } class Token{ public $coffee; public $username; public function __construct($coffee, $username){ $this->coffee = (string)$coffee; $this->username = (string)$username; $this->crypto = "crc32"; } public function __toString(){ $x = $this->crypto; return substr(md5(rand($x($this->coffee . $this->username), 0xc0ffee)), 10); } } $a = new Token("a","b"); $a->crypto = "c"; var_dump(serialize($a));

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.0040.01514.60
7.4.00.0060.01214.97
7.3.130.0070.01314.86
7.3.120.0170.00014.57
7.3.110.0160.00314.64
7.3.100.0000.01414.57
7.3.90.0040.01114.72
7.3.80.0100.00714.75
7.3.70.0070.01014.72
7.3.60.0040.00814.64
7.3.50.0060.00814.57
7.3.40.0070.01014.52
7.3.30.0050.01214.46
7.3.20.0450.00215.59
7.3.10.0310.00315.84
7.3.00.0220.00715.99
7.2.260.0160.00314.48
7.2.250.0110.00714.63
7.2.240.0030.01314.84
7.2.230.0140.00015.16
7.2.220.0070.01115.05
7.2.210.0030.01714.98
7.2.200.0040.00915.14
7.2.190.0060.00614.75
7.2.180.0070.01114.71
7.2.170.0110.00414.79
7.2.160.0110.00614.77
7.2.150.0510.00815.89
7.2.140.0460.00615.92
7.2.130.0340.00716.29
7.2.120.0520.00716.06
7.2.110.0870.00415.93
7.2.100.0930.00715.90
7.2.90.0380.00915.95
7.2.80.0330.00616.07
7.2.70.0240.01116.02
7.2.60.0270.00616.01
7.2.50.0280.00716.02
7.2.40.0270.00816.18
7.2.30.0300.00916.87
7.2.20.0340.00816.89
7.2.10.0190.01016.80
7.2.00.0250.01017.00
7.1.330.0060.00915.34
7.1.320.0000.01715.57
7.1.310.0100.00315.99
7.1.300.0030.00815.61
7.1.290.0070.01015.55
7.1.280.0040.00815.30
7.1.270.0480.00414.69
7.1.260.0390.01114.70
7.1.250.0490.00615.08
7.1.240.0940.00414.55
7.1.230.0950.00714.55
7.1.220.1060.00814.56
7.1.210.0580.00614.53
7.1.200.0590.01214.60
7.1.190.0310.01014.68
7.1.180.0490.00814.52
7.1.170.0290.00914.45
7.1.160.0380.00914.63
7.1.150.0310.00915.74
7.1.140.0240.01015.59
7.1.130.0240.01115.72
7.1.120.0220.01015.65
7.1.110.0210.00915.44
7.1.100.0180.01015.74
7.1.90.0280.00915.76
7.1.80.0320.00715.82
7.1.70.0240.01015.40
7.1.60.0250.01123.23
7.1.50.0260.01022.93
7.1.40.0230.01322.88
7.1.30.0310.01222.86
7.1.20.0280.01122.88
7.1.10.0220.00815.19
7.1.00.0220.00715.30
7.0.330.0510.00714.07
7.0.320.1360.00414.10
7.0.310.0400.00614.18
7.0.300.0460.00614.11
7.0.290.0910.00414.28
7.0.280.0370.00614.04
7.0.270.0430.00915.39
7.0.260.0490.00915.42
7.0.250.0540.00815.08
7.0.240.0190.01015.57
7.0.230.0350.00715.61
7.0.220.0280.01015.69
7.0.210.0230.00814.96
7.0.200.0280.00815.11
7.0.190.0270.00715.12
7.0.180.0280.00814.88
7.0.170.0240.01414.91
7.0.160.0250.01114.92
7.0.150.0210.01114.93
7.0.140.0300.00814.78
7.0.130.0210.00915.18
7.0.120.0280.00815.12
7.0.110.0250.01014.88
7.0.100.0270.01214.95
7.0.90.0480.00914.94
7.0.80.0230.01115.03
7.0.70.0500.00814.92
7.0.60.0240.00914.82
7.0.50.0250.00914.91
7.0.40.0240.00914.69
7.0.30.0250.00814.67
7.0.20.0270.00714.64
7.0.10.0280.00814.66
7.0.00.0740.00814.71
5.6.400.0120.00814.17
5.6.390.0180.00913.65
5.6.380.0080.01014.23

preferences:
38.83 ms | 400 KiB | 5 Q