3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $vrot = new Pisa(); class Pisa { function __construct() { $this->_vrot = true; $this->_toPisa(); var_dump($this->_vrot); } private static function _toPisa() { $this->_vrot = 'PISA VROT'; } }
based on Jf2Wp
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/Xnru4:18 Stack trace: #0 /in/Xnru4(12): Pisa::_toPisa() #1 /in/Xnru4(4): Pisa->__construct() #2 {main} thrown in /in/Xnru4 on line 18
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Fatal error: Using $this when not in object context in /in/Xnru4 on line 18
Process exited with code 255.