Deprecated: Return type of Stringy\Stringy::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/danielstjules/stringy/src/Stringy.php on line 270

Deprecated: Return type of Stringy\Stringy::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/danielstjules/stringy/src/Stringy.php on line 453

Deprecated: Return type of Stringy\Stringy::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/danielstjules/stringy/src/Stringy.php on line 850

Deprecated: Return type of Stringy\Stringy::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/danielstjules/stringy/src/Stringy.php on line 873

Deprecated: Return type of Stringy\Stringy::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/danielstjules/stringy/src/Stringy.php on line 893

Deprecated: Return type of Stringy\Stringy::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/danielstjules/stringy/src/Stringy.php on line 906
Calculator

Calculator

We need a simple web-based calculator. It should cover 4 operations: add, subtract, multiply and divide. The calculator should be executed in the following manner:

http://localhost:8000/calculator.php?op=sum&x=3&y=4
http://localhost:8000/calculator.php?op=subtract&x=3&y=4
http://localhost:8000/calculator.php?op=multiply&x=3&y=4
http://localhost:8000/calculator.php?op=divide&x=3&y=4

The output should be the following:

Try to handle incorrect input data:

  1. for the unrecognized operation your should show:
  2. in case of any other problems you should show the following screens: