3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Student { private static $age = NULL; public function setAge($age) { Student::$age = $age; return $this; } } Student::setAge(20);
based on WjQUP
Output for 7.1.0 - 7.2.0
Deprecated: Non-static method Student::setAge() should not be called statically in /in/YUP2M on line 12 Fatal error: Uncaught Error: Using $this when not in object context in /in/YUP2M:7 Stack trace: #0 /in/YUP2M(12): Student::setAge(20) #1 {main} thrown in /in/YUP2M on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Deprecated: Non-static method Student::setAge() should not be called statically in /in/YUP2M on line 12 Notice: Undefined variable: this in /in/YUP2M on line 7
Output for 5.3.19 - 5.6.28
Strict Standards: Non-static method Student::setAge() should not be called statically in /in/YUP2M on line 12 Notice: Undefined variable: this in /in/YUP2M on line 7