@Malleys/

WebbedSquigglyCell

PHP (Legacy)

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7344318943617327","path":"main.php","file":{"path":"main.php","content":{"asEncoding":{"base64":"PD9waHAKCmludGVyZmFjZSBTYXkgewoJcHVibGljIGZ1bmN0aW9uIHNheSgpOwp9CgphYnN0cmFjdCBjbGFzcyBBbmltYWwgaW1wbGVtZW50cyBTYXkgewoJcHJvdGVjdGVkICRuYW1lOwoJcHJvdGVjdGVkICRuaWNrbmFtZTsKCXByb3RlY3RlZCAkY29sb3Jpbmc7Cglwcm90ZWN0ZWQgJGJyZWVkOwoJcHJvdGVjdGVkICRhZ2U7CgoJcHVibGljIGZ1bmN0aW9uIF9fY29uc3RydWN0KCRuYW1lLCAkbmlja25hbWUsICRjb2xvcmluZywgJGJyZWVkLCAkYWdlKSB7CgkJJHRoaXMtPm5hbWUgPSAkbmFtZTsKCQkkdGhpcy0+bmlja25hbWUgPSAkbmlja25hbWU7CgkJJHRoaXMtPmNvbG9yaW5nID0gJGNvbG9yaW5nOwoJCSR0aGlzLT5icmVlZCA9ICRicmVlZDsKCQkkdGhpcy0+YWdlID0gJGFnZTsKCX0KfQoKY2xhc3MgRG9nIGV4dGVuZHMgQW5pbWFsIHsKCXB1YmxpYyBmdW5jdGlvbiBzYXkoKSB7CgkJcmV0dXJuICLQryAtIHskdGhpcy0+bmFtZX0geyR0aGlzLT5jb2xvcmluZ30g0L7QutGA0LDRgdCwLCDQv9C+0YDQvtC00YsgLSB7JHRoaXMtPmJyZWVkfSwg0LfQvtCy0YPRgiDQvNC10L3RjyAtIHskdGhpcy0+bmlja25hbWV9LCDQvNC90LUg0YHQtdC50YfQsNGBIHskdGhpcy0+YWdlfSI7Cgl9Cn0KY2xhc3MgQ2F0IGV4dGVuZHMgQW5pbWFsIHsKCXB1YmxpYyBmdW5jdGlvbiBzYXkoKSB7CgkJcmV0dXJuICLQryAtIHskdGhpcy0+bmFtZX0geyR0aGlzLT5jb2xvcmluZ30g0L7QutGA0LDRgdCwLCDQv9C+0YDQvtC00YsgLSB7JHRoaXMtPmJyZWVkfSwg0LfQvtCy0YPRgiDQvNC10L3RjyAtIHskdGhpcy0+bmlja25hbWV9LCDQvNC90LUg0YHQtdC50YfQsNGBIHskdGhpcy0+YWdlfSI7Cgl9Cn0KCiRkb2cgPSBuZXcgRG9nKCfRgdC+0LHQsNC60LAnLCAn0KDQtdC60YEnLCAn0LHQtdC70L7Qs9C+JywgJ9Cd0LXQvNC10YYnLCAnNSDQu9C10YInKTsgCmVjaG8gJGRvZy0+c2F5KCk7CgplY2hvICJcblxuIjsKCiRjYXQgPSBuZXcgQ2F0KCfQutC+0YjQutCwJywgJ9Cc0LDRgNC60LjQt9CwJywgJ9C/0Y/RgtC90LjRgdGC0L7Qs9C+JywgJ9Ch0YTQuNC90LrRgScsICcyINCz0L7QtNCwJyk7IAplY2hvICRjYXQtPnNheSgpOwoKPz4K"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

interface Say {
	public function say();
}

abstract class Animal implements Say {
	protected $name;
	protected $nickname;
	protected $coloring;
	protected $breed;
	protected $age;

	public function __construct($name, $nickname, $coloring, $breed, $age) {
		$this->name = $name;
		$this->nickname = $nickname;
		$this->coloring = $coloring;
		$this->breed = $breed;
		$this->age = $age;
	}
}

class Dog extends Animal {
	public function say() {
		return "Я - {$this->name} {$this->coloring} окраса, породы - {$this->breed}, зовут меня - {$this->nickname}, мне сейчас {$this->age}";
	}
}
class Cat extends Animal {
	public function say() {
		return "Я - {$this->name} {$this->coloring} окраса, породы - {$this->breed}, зовут меня - {$this->nickname}, мне сейчас {$this->age}";
	}
}

$dog = new Dog('собака', 'Рекс', 'белого', 'Немец', '5 лет'); 
echo $dog->say();

echo "\n\n";

$cat = new Cat('кошка', 'Маркиза', 'пятнистого', 'Сфинкс', '2 года'); 
echo $cat->say();

?>
PHP 7.0.8 (Legacy: use the following for new features: Command-line PHP: https://repl.it/languages/php_cli PHP Web Server: https://repl.it/languages/php7