3v4l.org

run code in 300+ PHP versions simultaneously
<?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/essjc 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/essjc on line 3
Process exited with code 255.

preferences:
167.11 ms | 1399 KiB | 41 Q