@MaksimSienchien/

LimitedTrimAfkgaming-1

PHP (Legacy)

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.743115200772076","path":"main.php","file":{"path":"main.php","content":{"asEncoding":{"base64":"PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKbWJfaW50ZXJuYWxfZW5jb2RpbmcoJ3V0Zi04Jyk7CgokaW5wdXQ9JzUtNys4MCoyKzUqND0nOwokaW5wdXRMZW5naHQ9bWJfc3RybGVuKCRpbnB1dCk7CiRudW1iZXI9MDsKJHJlc3VsdD0wOwokb3A9Jyc7CmZvciAoJGk9MDsgJGk8JGlucHV0TGVuZ2h0OyAkaSsrKQoJewkJCQoJCSRjaGFyID0gbWJfc3Vic3RyKCRpbnB1dCwgJGksIDEpOwoJCWlmIChpc19udW1lcmljKCRjaGFyKSkKCQl7CgkJCSRjaGFyQXJyYXlbXT0kY2hhcjsKCQl9CgkJZWxzZWlmICgkY2hhcj09JysnIHx8ICRjaGFyPT0nLScgfHwgJGNoYXI9PScqJ3x8ICRjaGFyPT0nPScpCgkJewoJCQkkbnVtYmVyPWltcGxvZGUoJGNoYXJBcnJheSk7CgkJCSRudW1iZXI9aW50dmFsKCRudW1iZXIpOwoJCQllY2hvICJvcCA9IFskb3BdLCByZXN1bHQgPSBbJHJlc3VsdF0sIG51bWJlciA9IFskbnVtYmVyXSwgY2hhciA9IFskY2hhcl1cbiIgOwoJCQlpZiAoJG9wPT0nJykKCQkJewoJCQkJJHJlc3VsdD0kbnVtYmVyOwoJCQl9CgkJCWlmICgkb3A9PScrJykKCQkJewoJCQkJJHJlc3VsdCs9JG51bWJlcjsKCQkJfQoJCQlpZiAoJG9wPT0nLScpCgkJCXsKCQkJCSRyZXN1bHQtPSRudW1iZXI7CgkJCX0KCQkJaWYgKCRvcD09JyonKQoJCQl7CgkJCQkkcmVzdWx0Kj0kbnVtYmVyOwoJCQl9CgkJCWlmICgkY2hhcj09Jz0nKQoJCQl7CgkJCQllY2hvICLQntGC0LLQtdGCOiAkaW5wdXQkcmVzdWx0IjsKCQkJfQoJCQkkb3A9JGNoYXI7CgkJCSRjaGFyQXJyYXk9W107CQoJCX0KCQllbHNlCgkJewoJCQllY2hvICLQndC10LLQtdGA0L3Ri9C5INGB0LjQvNCy0L7QuzogWyRjaGFyXVxuIjsKCQkJZXhpdCgpOwoJCX0KCX0KPz4="},"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
44
45
46
47
48
49
50
51
<?php
error_reporting(-1);
mb_internal_encoding('utf-8');

$input='5-7+80*2+5*4=';
$inputLenght=mb_strlen($input);
$number=0;
$result=0;
$op='';
for ($i=0; $i<$inputLenght; $i++)
	{			
		$char = mb_substr($input, $i, 1);
		if (is_numeric($char))
		{
			$charArray[]=$char;
		}
		elseif ($char=='+' || $char=='-' || $char=='*'|| $char=='=')
		{
			$number=implode($charArray);
			$number=intval($number);
			echo "op = [$op], result = [$result], number = [$number], char = [$char]\n" ;
			if ($op=='')
			{
				$result=$number;
			}
			if ($op=='+')
			{
				$result+=$number;
			}
			if ($op=='-')
			{
				$result-=$number;
			}
			if ($op=='*')
			{
				$result*=$number;
			}
			if ($char=='=')
			{
				echo "Ответ: $input$result";
			}
			$op=$char;
			$charArray=[];	
		}
		else
		{
			echo "Неверный символ: [$char]\n";
			exit();
		}
	}
?>
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