3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyObjectStorage extends SplObjectStorage { // Overwrite getHash() with just some (working) test-method public function getHash($object) { return get_class($object); } } class TestObject {} $list = new MyObjectStorage(); // No issues if using "new SplObjectStorage()" $list->attach(new TestObject()); foreach($list as $x) var_dump($list->offsetExists($x)); // TRUE $list2 = clone $list; foreach($list2 as $x) var_dump($list2->offsetExists($x)); // FALSE
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of MyObjectStorage::getHash($object) should either be compatible with SplObjectStorage::getHash(object $object): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/Kc9u1 on line 4 bool(true) bool(true)

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:
41.61 ms | 401 KiB | 8 Q