3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StringNotEmptyType { public string $s; public function __construct(string $s) { $s = trim($s); if ($s === '') { throw new Exception('String must not be emtpy'); } $this->s = $s; } public function __toString() : string { return $this->s; } public static function create(string $s) : self { return new self($s); } } class Something { public StringNotEmptyType $s; } $okay = new Something(); $okay->s = StringNotEmptyType::create('not empty'); echo $okay->s; $okay = new Something(); $okay->s = StringNotEmptyType::create('');

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.4.140.0130.00817.95
8.4.130.0130.00819.59
8.4.120.0070.00620.50
8.4.110.0140.00620.29
8.4.100.0130.00717.91
8.4.90.0130.00918.59
8.4.80.0100.01020.54
8.4.70.0120.00718.37
8.4.60.0080.00718.48
8.4.50.0130.00718.57
8.4.40.0160.00317.79
8.4.30.0140.00720.61
8.4.20.0070.01417.87
8.4.10.0090.00019.55
8.3.270.0120.00816.79
8.3.260.0100.01016.71
8.3.250.0060.00818.82
8.3.240.0060.00316.94
8.3.230.0090.00816.82
8.3.220.0040.00419.12
8.3.210.0120.00716.88
8.3.200.0110.00816.68
8.3.190.0070.01317.06
8.3.180.0100.00916.91
8.3.170.0070.01120.71
8.3.160.0150.00317.30
8.3.150.0070.01117.43
8.3.140.0110.00717.32
8.3.130.0030.00618.62
8.3.120.0080.00018.84
8.3.110.0110.00720.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0090.00316.75
8.3.70.0140.00016.75
8.3.60.0080.00816.88
8.3.50.0080.01323.47
8.3.40.0160.00318.98
8.3.30.0110.00318.92
8.3.20.0070.00320.77
8.3.10.0040.00420.34
8.3.00.0040.00420.52
8.2.290.0090.00320.48
8.2.280.0060.00220.32
8.2.270.0150.00417.13
8.2.260.0090.00619.01
8.2.250.0080.00016.79
8.2.240.0040.00417.39
8.2.230.0080.00022.58
8.2.220.0030.00637.54
8.2.210.0000.00826.77
8.2.200.0060.00318.41
8.2.190.0090.00917.00
8.2.180.0040.01118.54
8.2.170.0000.01422.96
8.2.160.0060.00620.27
8.2.150.0090.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00319.66
8.2.110.0090.00020.47
8.2.100.0070.00417.90
8.2.90.0040.00417.91
8.2.80.0030.00519.23
8.2.70.0000.00817.80
8.2.60.0000.00818.09
8.2.50.0040.00419.41
8.2.40.0050.00321.12
8.2.30.0000.00919.25
8.2.20.0000.00818.06
8.2.10.0000.00819.20
8.2.00.0000.00719.17
8.1.330.0140.00521.95
8.1.320.0060.00416.32
8.1.310.0110.00716.79
8.1.300.0000.01918.61
8.1.290.0100.00030.84
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0130.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00720.91
8.1.230.0070.00422.74
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0000.00817.35
8.1.180.0070.00019.09
8.1.170.0030.00718.39
8.1.160.0050.00218.93
8.1.150.0030.00518.80
8.1.140.0000.00718.95
8.1.130.0040.00418.89
8.1.120.0000.00717.39
8.1.110.0040.00417.39
8.1.100.0000.00817.48
8.1.90.0000.00717.38
8.1.80.0030.00317.46
8.1.70.0040.00417.36
8.1.60.0040.00417.48
8.1.50.0030.00517.42
8.1.40.0040.00417.35
8.1.30.0030.00617.49
8.1.20.0050.00317.65
8.1.10.0040.00417.63
8.1.00.0100.00017.48
8.0.300.0000.00720.16
8.0.290.0000.00816.88
8.0.280.0040.00418.36
8.0.270.0040.00416.94
8.0.260.0000.00918.48
8.0.250.0020.00517.05
8.0.240.0040.00417.04
8.0.230.0030.00317.03
8.0.220.0060.00016.96
8.0.210.0030.00316.88
8.0.200.0030.00316.91
8.0.190.0000.00816.99
8.0.180.0000.00816.95
8.0.170.0040.00416.88
8.0.160.0030.00416.97
8.0.150.0090.00016.79
8.0.140.0000.00816.81
8.0.130.0030.00313.43
8.0.120.0070.00016.84
8.0.110.0040.00416.91
8.0.100.0040.00416.90
8.0.90.0050.00317.02
8.0.80.0060.01216.89
8.0.70.0040.00416.95
8.0.60.0000.00716.85
8.0.50.0040.00416.91
8.0.30.0110.00617.07
8.0.20.0090.00917.25
8.0.10.0040.00416.95
8.0.00.0060.01317.07
7.4.330.0030.00315.55
7.4.320.0030.00316.52
7.4.300.0070.00016.47
7.4.290.0080.00016.43
7.4.280.0040.00416.42
7.4.270.0000.00716.51
7.4.260.0000.00513.21
7.4.250.0030.00316.56
7.4.240.0030.00316.67
7.4.230.0070.00016.63
7.4.220.0000.00716.68
7.4.210.0080.00816.55
7.4.200.0000.00716.59
7.4.130.0140.00316.54
7.4.120.0060.01616.50
7.4.110.0050.01416.67
7.4.100.0070.01116.50
7.4.90.0070.01016.61
7.4.80.0100.01319.39
7.4.70.0100.00816.77
7.4.60.0160.00016.74
7.4.50.0030.01316.50
7.4.40.0110.00616.70
7.4.30.0080.00716.49
7.4.20.0100.00816.41
7.4.10.0090.00816.46
7.4.00.0080.01016.52
7.3.330.0000.00716.09
7.3.320.0060.00013.11
7.3.310.0030.00516.11
7.3.300.0070.00016.09
7.3.290.0040.01216.15
7.3.260.0170.00316.25
7.3.230.0100.00616.13
7.3.210.0080.00816.41
7.3.200.0160.00016.13
7.3.190.0070.01416.16
7.3.180.0100.00716.23
7.3.170.0120.01016.45
7.3.160.0100.00716.32
7.3.150.0080.00716.26
7.3.140.0090.01016.23
7.3.130.0090.00716.22
7.3.120.0090.00816.21
7.3.110.0100.00916.23
7.3.100.0070.00916.15
7.3.90.0080.00616.18
7.3.80.0080.00916.16
7.3.70.0080.00916.12
7.3.60.0070.00916.16
7.3.50.0090.00816.21
7.3.40.0100.00816.19
7.3.30.0100.00616.24
7.3.20.0120.00616.18
7.3.10.0100.00916.16
7.3.00.0090.00616.23
7.2.330.0100.01416.24
7.2.320.0060.01016.22
7.2.310.0090.01416.53
7.2.300.0230.00016.17
7.2.290.0060.01016.54
7.2.280.0060.01116.30
7.2.270.0100.00716.36
7.2.260.0100.00716.38
7.2.250.0120.00616.28
7.2.240.0110.00816.26
7.2.230.0080.00816.36
7.2.220.0080.01016.36
7.2.210.0080.01016.34
7.2.200.0090.00716.21
7.2.190.0080.01016.32
7.2.180.0100.00816.27
7.2.170.0100.00816.29
7.2.160.0070.00916.26
7.2.150.0090.00916.38
7.2.140.0090.00916.35
7.2.130.0080.00816.31
7.2.120.0060.01016.38
7.2.110.0090.01016.33
7.2.100.0110.00716.40
7.2.90.0100.00816.37
7.2.80.0050.01116.26
7.2.70.0080.00816.39
7.2.60.0100.00716.35
7.2.50.0100.00716.32
7.2.40.0110.00816.39
7.2.30.0100.01116.36
7.2.20.0080.01016.29
7.2.10.0070.00916.38
7.2.00.0100.00816.39

preferences:
114.06 ms | 403 KiB | 5 Q