3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { protected array $tags; public function __get(string $prop): mixed { if (property_exists($this, $prop)) { return $this->{$prop}; } } public function __set(string $prop, mixed $val): void { if (property_exists($this, $prop)) { $this->$prop = $val; } } } class CarMapper { public function test(Car $car): void { echo 'そのままだとtrueになる'.PHP_EOL; var_dump(empty($car->tags)); // bool(true) echo '代入するとfalseになる'.PHP_EOL; $tags = $car->tags; var_dump(empty($tags)); // bool(false) } } $car = new Car(); $car->tags = ['tag1']; $carMapper = new CarMapper(); $carMapper->test($car);

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.5.10.0120.00716.81
8.5.00.0100.01420.02
8.4.160.0150.00623.82
8.4.150.0020.00114.05
8.4.140.0110.01017.36
8.4.130.0030.00717.52
8.4.120.0120.00720.61
8.4.110.0110.00822.63
8.4.100.0140.00617.76
8.4.90.0070.00320.73
8.4.80.0120.00618.80
8.4.70.0040.00517.76
8.4.60.0150.00717.91
8.4.50.0110.01118.70
8.4.40.0150.00417.48
8.4.30.0130.00719.07
8.4.20.0100.01017.98
8.4.10.0060.00319.38
8.3.280.0110.01018.41
8.3.270.0130.00616.70
8.3.260.0120.00716.66
8.3.250.0110.00718.90
8.3.240.0060.00316.55
8.3.230.0110.00816.72
8.3.220.0110.00719.16
8.3.210.0080.00616.59
8.3.200.0090.00916.69
8.3.190.0080.01217.16
8.3.180.0120.00716.88
8.3.170.0080.00019.04
8.3.160.0090.00916.71
8.3.150.0040.00417.04
8.3.140.0110.00716.70
8.3.130.0000.00818.46
8.3.120.0080.00318.98
8.3.110.0030.00620.94
8.3.100.0040.00416.54
8.3.90.0050.00326.77
8.3.80.0060.00318.43
8.3.70.0090.00616.25
8.3.60.0040.01116.61
8.3.50.0070.00718.42
8.3.40.0130.00621.84
8.3.30.0130.00718.76
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0100.00820.41
8.2.280.0090.01016.54
8.2.270.0100.00018.62
8.2.260.0190.00017.26
8.2.250.0040.00416.82
8.2.240.0040.00417.15
8.2.230.0040.00422.58
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0030.00616.61
8.2.190.0060.00916.58
8.2.180.0110.00718.29
8.2.170.0090.00919.09
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00420.71
8.2.110.0100.00820.43
8.2.100.0070.01118.75
8.2.90.0140.01118.96
8.2.80.0180.00018.64
8.2.70.0110.00718.76
8.2.60.0110.00018.59
8.2.50.0080.00318.72
8.2.40.0110.00018.64
8.2.30.0060.00318.71
8.2.20.0050.00518.70
8.2.10.0030.00718.64
8.2.00.0070.00318.71
8.1.330.0130.00618.46
8.1.320.0100.00916.05
8.1.310.0070.00018.52
8.1.300.0130.00716.11
8.1.290.0070.00330.84
8.1.280.0120.00325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0070.00318.45
8.1.230.0100.00020.48
8.1.220.0100.00020.25
8.1.210.0100.00021.77
8.1.200.0070.00318.62
8.1.190.0050.00518.34
8.1.180.0070.00318.57
8.1.170.0070.00318.48
8.1.160.0070.00318.52
8.1.150.0000.01118.67
8.1.140.0050.00518.49
8.1.130.0000.01018.61
8.1.120.0110.00018.47
8.1.110.0070.00318.40
8.1.100.0070.00318.35
8.1.90.0070.00318.35
8.1.80.0000.01018.41
8.1.70.0070.00318.56
8.1.60.0070.00318.55
8.1.50.0100.00018.52
8.1.40.0060.00318.62
8.1.30.0080.00318.68
8.1.20.0080.00318.70
8.1.10.0000.00918.75
8.1.00.0100.00018.63
8.0.300.0060.00317.96
8.0.290.0090.00017.82
8.0.280.0060.00317.96
8.0.270.0060.00317.83
8.0.260.0060.00319.81
8.0.250.0100.00019.60
8.0.240.0080.00319.82
8.0.230.0100.00019.69
8.0.220.0060.00319.84
8.0.210.0090.00019.82
8.0.200.0070.00319.89
8.0.190.0060.00319.79
8.0.180.0030.00619.89
8.0.170.0060.00319.93
8.0.160.0030.00619.70
8.0.150.0100.00019.48
8.0.140.0110.00019.70
8.0.130.0000.01119.81
8.0.120.0080.00319.87
8.0.110.0030.00619.93
8.0.100.0070.00319.75
8.0.90.0070.00319.70
8.0.80.0110.00017.84
8.0.70.0050.00517.76
8.0.60.0110.00018.00
8.0.50.0100.00018.00
8.0.30.0050.00517.96
8.0.20.0060.00617.96
8.0.10.0100.00018.19

preferences:
33.67 ms | 403 KiB | 5 Q