3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function replaceArgument($index, $argument) { if ($index < 0 || $index > count($this->arguments) - 1) { throw new \Exception(); } $this->arguments[$index] = $argument; return $this; } replaceArgument(1, null);
based on OqGqZ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/kpF5B:5 Stack trace: #0 /in/kpF5B(14): replaceArgument(1, NULL) #1 {main} thrown in /in/kpF5B on line 5
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Using $this when not in object context in /in/kpF5B on line 5
Process exited with code 255.