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('http://php.net'); var_dump($f);

preferences:
30.97 ms | 402 KiB | 5 Q