3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class state { public $board; public $h,$g,$f; public function computeH() { }; public function makeMove($dir) { //0 up, 1 right , 2 down, 3 left }; public function generateChildren() { }; }; class dupa implements czlowiek{ public function a() {} public function b(){} public $a; public static $NICE = 'STATIC_VALUE'; public function __construct($param) { if(preg_match('/^[bla]+/',$param)){ $this->a = $param; echo '+_construct'.$this->a.self::$NICE; } else { echo 'dupa'; } } public static function stat(){ echo "\nWywolano metode statyczna"; } public function __call($a, $b) { echo "\n".'Wywolano metodÄ™ \''.$a.'\' z parametrami:'."\n"; foreach($b as $i=>$val) { echo 'indeks: '.$i.' wartosc: '.$val."\n"; } } public function setA($a) { $this->a = $a; } }; $a = new dupa('blabla'); echo $a->a; $b = new dupa(''); echo $b->a; $b->setA('bb'); $b->setb('bb',8,true); echo dupa::$NICE; dupa::stat(); ?>
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected ';', expecting function (T_FUNCTION) in /in/RNpIf on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /in/RNpIf on line 7
Process exited with code 255.