3v4l.org

run code in 300+ 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 git.master
public_private_set: isPrivateSet() = true, isProtectedSet() = false private_private_set: isPrivateSet() = false, isProtectedSet() = false private: isPrivateSet() = false, isProtectedSet() = false public_readonly: isPrivateSet() = false, isProtectedSet() = true protected_readonly: isPrivateSet() = false, isProtectedSet() = false protected_protected_set_readonly: isPrivateSet() = false, isProtectedSet() = false

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
133.93 ms | 996 KiB | 7 Q