3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dupa { public $a = 'j'; public static $NICE = 'STATIC_VALUE'; public function __construct($param) { $this->a = $param; echo '+_construct'.$this->a.self::$NICE; } public function__call($a, $b) { echo 'Wywolano metodÄ™ '.$a.' z parametrem'.$b; } public function setA($a) { $this->a = $a; } }; $a = new dupa('blabla'); echo $a->a; $b = new dupa(''); echo $b->a; $b->setA('bb');?>
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'function__call' (T_STRING), expecting variable (T_VARIABLE) in /in/fmbuu on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/fmbuu on line 11
Process exited with code 255.

preferences:
186.01 ms | 1395 KiB | 64 Q