3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*{ "_id" : ObjectId("595baefce2810a6a8a94fe2d"), "user" : "1234abc", "type" : "session-started", "name" : "moja o sesja", "reference_id" : "hippo-123", "created_on" : ISODate("2017-01-01T01:01:01.123Z") }*/ class A { private static $_id = 0x595baefce2810a6a8a94fe2d; private $user; private $type; private $reference_id; private $created_on; public function __construct($user, $type, $reference_id, $created_on) { $this->user = $user; $this->type = $type; $this->reference_id = $reference_id; $this->created_on = $created_on; } public function __toString() { return sprintf('{ "_id": ObjectId("%x"), "user": "%s", "type": "%s", "name": "my %s", "reference_id": "hippo-%s", "created_on": ISODate("%s.000Z") }', ++self::$_id, $this->user, $this->type, $this->type, $this->reference_id, $this->created_on ); } } echo new A('u1', 'session_started', 11, '2017-01-01T01:01:01');

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)
8.3.60.0180.00018.56
8.3.50.0140.00418.31
8.3.40.0110.00718.82
8.3.30.0150.00018.98
8.3.20.0000.00820.27
8.3.10.0030.00621.86
8.3.00.0040.00419.81
8.2.180.0100.01016.35
8.2.170.0120.00622.96
8.2.160.0100.00319.22
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0090.00019.43
8.2.120.0040.00426.35
8.2.110.0060.00320.39
8.2.100.0120.00017.91
8.2.90.0080.00019.17
8.2.80.0000.00817.97
8.2.70.0030.00717.63
8.2.60.0050.00318.05
8.2.50.0000.00818.16
8.2.40.0000.00720.73
8.2.30.0000.00719.43
8.2.20.0040.00418.21
8.2.10.0050.00218.10
8.2.00.0030.00318.09
8.1.280.0060.01025.92
8.1.270.0070.00022.31
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00923.92
8.1.230.0040.00824.04
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0050.00317.47
8.1.180.0030.00518.10
8.1.170.0050.00318.69
8.1.160.0000.00718.99
8.1.150.0070.00319.02
8.1.140.0070.00019.60
8.1.130.0030.00618.86
8.1.120.0000.00717.53
8.1.110.0080.00017.41
8.1.100.0000.00717.50
8.1.90.0040.00417.44
8.1.80.0000.00817.39
8.1.70.0080.00017.56
8.1.60.0040.00417.67
8.1.50.0060.00317.59
8.1.40.0080.00017.60
8.1.30.0040.00417.61
8.1.20.0030.00517.68
8.1.10.0000.00817.61
8.1.00.0000.00817.62
8.0.300.0000.00718.77
8.0.290.0080.00016.58
8.0.280.0030.00318.45
8.0.270.0030.00317.34
8.0.260.0060.00016.87
8.0.250.0000.00717.05
8.0.240.0040.00416.94
8.0.230.0030.00617.00
8.0.220.0070.00016.84
8.0.210.0030.00316.88
8.0.200.0000.00616.88
8.0.190.0030.00517.00
8.0.180.0040.00416.87
8.0.170.0080.00017.03
8.0.160.0040.00416.87
8.0.150.0030.00516.78
8.0.140.0040.00416.83
8.0.130.0060.00013.32
8.0.120.0050.00316.82
8.0.110.0040.00416.95
8.0.100.0000.00716.96
8.0.90.0070.00016.98
8.0.80.0090.00616.88
8.0.70.0050.00316.97
8.0.60.0000.00716.95
8.0.50.0070.00017.02
8.0.30.0090.01117.14
8.0.20.0120.00717.40
8.0.10.0040.00417.08
8.0.00.0100.01017.09
7.4.330.0070.00015.55
7.4.320.0060.00016.61
7.4.300.0000.00616.48
7.4.290.0000.00816.58
7.4.280.0040.00416.68
7.4.270.0070.00016.60
7.4.260.0040.00416.56
7.4.250.0070.00016.63
7.4.240.0000.00816.67
7.4.230.0030.00316.61
7.4.220.0070.01116.76
7.4.210.0090.01216.57
7.4.200.0030.00516.68
7.4.160.0090.00716.78
7.4.150.0160.00317.40
7.4.140.0120.00617.86
7.4.130.0190.00316.54
7.4.120.0120.01116.57
7.4.110.0120.00416.61
7.4.100.0120.00916.68
7.4.90.0080.00816.55
7.4.80.0090.01119.39
7.4.70.0090.00616.52
7.4.60.0120.00416.55
7.4.50.0080.00816.53
7.4.40.0080.00816.50
7.4.30.0140.00516.56
7.4.00.0070.01014.98
7.3.330.0000.00513.45
7.3.320.0030.00313.38
7.3.310.0070.00016.27
7.3.300.0030.00316.36
7.3.290.0090.00716.40
7.3.280.0070.00916.37
7.3.270.0100.00717.40
7.3.260.0130.00516.52
7.3.250.0070.01316.43
7.3.240.0150.00516.42
7.3.230.0130.01016.45
7.3.210.0060.00916.61
7.3.200.0070.01016.44
7.3.190.0100.01016.36
7.3.180.0140.00316.45
7.3.170.0090.00616.49
7.3.160.0090.00616.40
7.3.10.0080.00316.69
7.3.00.0000.01016.51
7.2.330.0030.01416.65
7.2.320.0090.01116.68
7.2.310.0070.01016.79
7.2.300.0100.00716.56
7.2.290.0070.01016.62
7.2.130.0100.00316.77
7.2.120.0080.00417.01
7.2.110.0070.00716.87
7.2.100.0040.01117.07
7.2.90.0000.01017.09
7.2.80.0070.00316.89
7.2.70.0030.00816.89
7.2.60.0070.00716.67
7.2.50.0090.00016.92
7.2.40.0070.00417.07
7.2.30.0070.00717.11
7.2.20.0070.00316.89
7.2.10.0060.00316.99
7.2.00.0060.00818.33
7.1.250.0040.00815.93
7.1.200.0130.00015.48
7.1.100.0030.01018.13
7.1.70.0000.01417.04
7.1.60.0180.01134.97
7.1.50.0160.01334.70
7.1.40.0190.01934.27
7.1.30.0160.02334.34
7.1.20.0210.01434.48
7.1.10.0060.00616.67
7.1.00.0030.01016.76
7.0.200.0080.00416.98
7.0.190.0060.00916.53
7.0.180.0030.01016.53
7.0.170.0080.00816.53
7.0.160.0100.00316.26
7.0.150.0000.01316.39
7.0.140.0070.00716.47
7.0.130.0060.00616.46
7.0.120.0030.00916.60
7.0.110.0030.01016.61
7.0.100.0000.01316.66
7.0.90.0030.00916.50
7.0.80.0060.00616.65
7.0.70.0000.01216.40
7.0.60.0000.01315.98
7.0.50.0060.00916.46
7.0.40.0030.01016.41
7.0.30.0090.00616.25
7.0.20.0070.00716.68
7.0.10.0060.00816.53
7.0.00.0100.00316.57

preferences:
51.96 ms | 401 KiB | 5 Q