3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo extends IteratorIterator { function __construct( $items ) { if ( is_array( $items ) ) { $items = new ArrayIterator( $items ); } } function __debugInfo() { throw new \Exception(); return [ "count" => iterator_count( $this ) ]; } } $a = new Foo( [ 1,2,3 ] ); var_dump( $a ); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Uncaught Exception in /in/EJpD4:14 Stack trace: #0 [internal function]: Foo->__debugInfo() #1 /in/EJpD4(20): var_dump(Object(Foo)) #2 {main} thrown in /in/EJpD4 on line 14 Fatal error: __debuginfo() must return an array in /in/EJpD4 on line 20
Process exited with code 255.

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