3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public readonly int $v; } $a = new A; $b = new ArrayObject($a); $b['v'] = 'hello'; $b['v'] = 'world'; echo $a->v; //"world"
Output for 8.5.0 - 8.5.3
Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in /in/5UYWZ on line 5 world
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18
world

preferences:
51.96 ms | 838 KiB | 4 Q