3v4l.org

run code in 300+ PHP versions simultaneously
<?php class File { // "Resource(stream)" isn't all that useful private $fp; // But all the stream meta data is public function __debugInfo() { return $this->fp ? stream_get_meta_data($fp) : []; } public function open($filename, $mode = 'r'){ $this->fp = fopen($filename, $mode); } } $f = new File; var_dump($f); // object(File)#1 { } $f->open('php://input'); var_dump($f);
Output for git.master, git.master_jit, rfc.property-hooks
object(File)#1 (0) { } Warning: Undefined variable $fp in /in/cmRhH on line 9 Warning: Uncaught TypeError: stream_get_meta_data(): Argument #1 ($stream) must be of type resource, null given in /in/cmRhH:9 Stack trace: #0 /in/cmRhH(9): stream_get_meta_data(NULL) #1 [internal function]: File->__debugInfo() #2 /in/cmRhH(20): var_dump(Object(File)) #3 {main} thrown in /in/cmRhH on line 9 Fatal error: __debuginfo() must return an array in /in/cmRhH 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:
35.37 ms | 402 KiB | 8 Q