3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { protected array $tags; public function __get(string $prop): mixed { print("__get($prop) called"); 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.00.0130.00919.73
8.4.150.0020.00014.05
8.4.140.0130.00817.73
8.4.130.0050.00418.64
8.4.120.0040.00424.13
8.4.110.0120.00317.89
8.4.100.0140.00519.07
8.4.90.0130.00720.34
8.4.80.0090.00818.79
8.4.70.0090.01118.16
8.4.60.0090.00919.05
8.4.50.0120.00917.76
8.4.40.0060.01517.69
8.4.30.0090.01018.92
8.4.20.0150.00417.65
8.4.10.0090.00019.31
8.3.280.0160.00520.10
8.3.270.0120.00716.69
8.3.260.0040.00516.59
8.3.250.0100.00518.80
8.3.240.0110.00817.11
8.3.230.0050.00316.77
8.3.220.0060.00218.84
8.3.210.0080.00018.40
8.3.200.0040.00416.68
8.3.190.0080.01016.50
8.3.180.0100.00519.09
8.3.170.0070.00318.79
8.3.160.0120.00616.53
8.3.150.0170.00320.70
8.3.140.0040.01117.41
8.3.130.0040.00418.07
8.3.120.0060.00318.93
8.3.110.0080.00420.94
8.3.100.0150.00316.45
8.3.90.0090.00626.77
8.3.80.0070.00317.97
8.3.70.0140.00018.43
8.3.60.0040.01116.48
8.3.50.0130.00616.57
8.3.40.0100.00321.78
8.3.30.0130.00318.84
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0030.00520.81
8.2.280.0140.00618.42
8.2.270.0100.00318.86
8.2.260.0180.00020.52
8.2.250.0080.00018.31
8.2.240.0130.00319.05
8.2.230.0040.00422.58
8.2.220.0160.00024.06
8.2.210.0040.00426.77
8.2.200.0040.00416.50
8.2.190.0070.01416.63
8.2.180.0070.00716.63
8.2.170.0110.00418.88
8.2.160.0070.01122.96
8.2.150.0030.00625.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00319.13
8.2.110.0130.00020.35
8.2.100.0090.00020.57
8.2.90.0030.00618.74
8.2.80.0050.00518.77
8.2.70.0050.00518.67
8.2.60.0070.00318.72
8.2.50.0040.00718.78
8.2.40.0060.00618.84
8.2.30.0090.00318.84
8.2.20.0070.00318.88
8.2.10.0060.00318.79
8.2.00.0000.00918.83
8.1.330.0130.00522.20
8.1.320.0100.00916.23
8.1.310.0070.00718.62
8.1.300.0080.00819.58
8.1.290.0000.00830.84
8.1.280.0140.00725.92
8.1.270.0080.00024.66
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0060.00318.48
8.1.230.0030.00618.49
8.1.220.0070.00318.52
8.1.210.0030.01021.73
8.1.200.0060.00620.36
8.1.190.0030.00718.42
8.1.180.0090.00018.43
8.1.170.0070.00318.47
8.1.160.0070.00418.47
8.1.150.0070.00318.68
8.1.140.0090.00318.52
8.1.130.0080.00418.63
8.1.120.0090.00318.68
8.1.110.0060.00318.67
8.1.100.0050.00518.55
8.1.90.0060.00318.63
8.1.80.0060.00318.50
8.1.70.0070.00418.72
8.1.60.0040.00818.72
8.1.50.0060.00618.63
8.1.40.0040.00718.61
8.1.30.0040.00718.82
8.1.20.0100.00018.86
8.1.10.0090.00018.74
8.1.00.0000.00918.75
8.0.300.0030.00617.83
8.0.290.0030.00617.96
8.0.280.0100.00017.79
8.0.270.0030.00617.79
8.0.260.0000.01017.88
8.0.250.0060.00318.01
8.0.240.0040.00417.96
8.0.230.0090.00017.82
8.0.220.0030.00617.90
8.0.210.0060.00317.82
8.0.200.0060.00317.96
8.0.190.0070.00417.95
8.0.180.0030.00618.01
8.0.170.0120.00017.93
8.0.160.0050.00517.93
8.0.150.0080.00317.71
8.0.140.0060.00318.01
8.0.130.0040.00417.94
8.0.120.0040.00417.93
8.0.110.0030.00617.87
8.0.100.0070.00317.93
8.0.90.0070.00417.93
8.0.80.0030.00817.92
8.0.70.0000.01017.78
8.0.60.0030.00717.78
8.0.50.0090.00017.88
8.0.30.0040.00417.97
8.0.20.0090.00017.96
8.0.10.0060.00318.05

preferences:
96.41 ms | 403 KiB | 5 Q