3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; public function __construct(){ echo('Very well!'); $this->a = 'X'; } public function e(){ $a = function() use ($this->a){ echo($this->a); echo('OK'); }; $a; } } $x = new A; $x->e();
Output for 5.3.0 - 5.3.20, 5.4.0 - 5.4.10
Fatal error: Cannot use $this as lexical variable in /in/WU1j0 on line 13
Process exited with code 255.

preferences:
172.28 ms | 1387 KiB | 39 Q