3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Hail{ public __construct() { $this->monday = function(){ return "monday"; }; $this->hello_monday = function(){ "what a beautiful ".$this->monday()."!"; }; } } $hoi = new Hail(); $hoi->{"hello_monday"}();
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected '__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/5J8mm on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/5J8mm on line 3
Process exited with code 255.