3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Content { protected array $data = array('sequence'=>1); public function &__get(string $property) : mixed { if(isset($this->data[$property]) === false): $this->data[$property] = null; endif; return $this->data[$property]; } public function __set(string $name,mixed $value) : void { $this->data[$name] = $value; } } final class MyClass { private object $content; public function __construct(){ $this->content = new Content(); } public function generateSequence() : int { $result = $this->content->sequence * 2 + 1; $this->content->sequence += 1; return $result; } } $myclass = new MyClass(); print $myclass->generateSequence();

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.120.0060.00320.80
8.3.110.0080.00020.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0080.00319.36
8.3.70.0120.00916.58
8.3.60.0120.00918.43
8.3.50.0120.00316.57
8.3.40.0040.01121.92
8.3.30.0060.00920.57
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0080.00026.16
8.2.240.0090.00317.29
8.2.230.0040.00422.58
8.2.220.0000.00837.54
8.2.210.0040.00426.77
8.2.200.0000.00918.88
8.2.190.0040.01116.88
8.2.180.0110.00716.50
8.2.170.0130.00319.09
8.2.160.0030.01422.96
8.2.150.0060.00325.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00419.45
8.2.110.0090.00922.23
8.2.100.0150.00420.92
8.2.90.0160.00720.51
8.2.80.0080.00420.45
8.2.70.0070.00718.95
8.2.60.0280.00618.75
8.2.50.0150.01119.94
8.2.40.0180.01418.95
8.2.30.0130.01018.89
8.2.20.0180.00619.20
8.2.10.0200.00319.21
8.2.00.0180.00619.09
8.1.300.0160.00317.75
8.1.290.0060.00330.84
8.1.280.0090.00925.92
8.1.270.0120.00624.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00418.63
8.1.230.0130.01318.69
8.1.220.0200.00318.57
8.1.210.0200.00419.95
8.1.200.0180.00718.50
8.1.190.0170.00318.16
8.1.180.0160.00018.59
8.1.170.0200.01318.49
8.1.160.0230.00718.79
8.1.150.0220.00620.61
8.1.140.0240.00718.44
8.1.130.0190.00618.20
8.1.120.0270.00018.48
8.1.110.0120.00019.58
8.1.100.0040.01218.53
8.1.90.0110.00618.40
8.1.80.0100.00318.28
8.1.70.0040.00918.51
8.1.60.0040.01118.80
8.1.50.0090.00618.39
8.1.40.0110.00318.97
8.1.30.0090.00318.86
8.1.20.0150.00018.81
8.1.10.0070.00718.85
8.1.00.0110.00318.75
8.0.300.0110.00417.78
8.0.290.0150.00017.90
8.0.280.0140.00017.90
8.0.270.0160.00017.71
8.0.260.0000.01118.40
8.0.250.0110.00417.89
8.0.240.0050.00917.89
8.0.230.0120.00018.31
8.0.220.0120.00417.88
8.0.210.0120.00318.00
8.0.200.0110.00417.88
8.0.190.0060.00618.29
8.0.180.0070.00717.86
8.0.170.0120.00317.86
8.0.160.0150.00017.93
8.0.150.0110.00417.88
8.0.140.0110.00417.89
8.0.130.0080.00418.21
8.0.120.0110.00417.58
8.0.110.0100.00317.95
8.0.100.0150.00017.79
8.0.90.0080.00817.83
8.0.80.0150.00017.69
8.0.70.0130.00317.74
8.0.60.0000.01218.23
8.0.50.0030.01217.88
8.0.30.0080.00418.28
8.0.20.0150.00017.90
8.0.10.0120.00317.86

preferences:
27.32 ms | 403 KiB | 5 Q