recruitment - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of recruitment.php
- <?php class FruitColor
- {
- private $fruitcolor;
- function __construct($fruitcolor)
- {
- $this->fruitcolor = $fruitcolor;
- }
- public function getFruits($color)
- {
- return null;
- }
- }
- $fruitcolor = new FruitColor(
- array (
- "red" => array("apple", "strawberry"),
- "yellow" => array("lemon", "ripe mango")
- )
- );
- echo $fruitcolor->getFruits("red");
- echo "===";
- echo $fruitcolor->getFruits("violet");
- echo "\n=========================\n";
- function groupByColor($fruits){
- return null;
- }
- var_dump(groupByColor(["a1" => "a", "b1" => "b", "a2" => "a"]));