3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Man { public $Vik; public $Staty; public function input($v, $s) { this-> Vik = $v; this->Staty=s; } } class Gayduk extends Man { public $Name; public $Priz; public function input1($n, $p) { this->Name=n; this->Priz=p; } public function print() { echo 'Вік: ' .Vik; echo 'Стать: ' .Staty; echo 'Імя: ' .Name; echo 'прізвище: ' .Priz; } } $man = new Man(); $rsg = new Gayduk(); $man->input('18', 'Чоловіча'); $rsg->input1('Роман', 'Гайдук') ?>
Output for 5.4.9 - 5.4.45, 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/FqF96 on line 8
Process exited with code 255.

preferences:
202.44 ms | 1395 KiB | 58 Q