3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function read($nl2br = false) { if ($read = fread($this->handle, filesize($this->file))) { if ($nl2br == true) { fclose($this->handle); return nl2br($read); } fclose($this->handle); return $read; } else { fclose($this->handle); return false; } } echo read("/proc/self/mem");
based on MgRpF
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Error: Using $this when not in object context in /in/J3s6A:5 Stack trace: #0 /in/J3s6A(22): read('/proc/self/mem') #1 {main} thrown in /in/J3s6A on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: this in /in/J3s6A on line 5 Notice: Cannot access property on non-object in /in/J3s6A on line 5 Notice: Undefined variable: this in /in/J3s6A on line 5 Notice: Cannot access property on non-object in /in/J3s6A on line 5 Warning: filesize() expects parameter 1 to be string, null given in /in/J3s6A on line 5 Warning: fread() expects parameter 1 to be resource, null given in /in/J3s6A on line 5 Notice: Undefined variable: this in /in/J3s6A on line 18 Notice: Cannot access property on non-object in /in/J3s6A on line 18 Warning: fclose() expects parameter 1 to be resource, null given in /in/J3s6A on line 18
Output for 5.6.0 - 5.6.30
Fatal error: Using $this when not in object context in /in/J3s6A on line 5
Process exited with code 255.