3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { // isPrivateSet() = true (OK) public private(set) mixed $public_private_set; // isPrivateSet() = false (I would expect true) private private(set) mixed $private_private_set; // isPrivateSet() = false (I would expect true) private mixed $private; // isProtectedSet() = true (OK, explained in the RFC) public readonly mixed $public_readonly; // isProtectedSet() = false (I would expect true) protected readonly mixed $protected_readonly; // isProtectedSet() = false (I would expect true) protected protected(set) readonly mixed $protected_protected_set_readonly; } foreach (new ReflectionClass(A::class)->getProperties() as $property) { echo $property->name; echo ': isPrivateSet() = ', $property->isPrivateSet() ? 'true' : 'false'; echo ', isProtectedSet() = ', $property->isProtectedSet() ? 'true' : 'false'; echo PHP_EOL; }
Output for 8.3.5
Fatal error: Multiple access type modifiers are not allowed in /in/O3FNN on line 6
Process exited with code 255.

preferences:
47.24 ms | 489 KiB | 3 Q