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.



Your result can be seen below.

Result of php executing





Full code of recruitment.php

  1. <?php class FruitColor
  2. {
  3.     private $fruitcolor;
  4.  
  5.     function __construct($fruitcolor)
  6.     {
  7.         $this->fruitcolor = $fruitcolor;
  8.     }
  9.  
  10. public function getFruits($color)
  11.     {
  12.         return null;
  13.     }
  14. }
  15.  
  16. $fruitcolor = new FruitColor(
  17.     array (
  18.         "red" => array("apple", "strawberry"),
  19.         "yellow" => array("lemon", "ripe mango")
  20.     )
  21. );
  22.  
  23. echo $fruitcolor->getFruits("red");
  24. echo "===";
  25. echo $fruitcolor->getFruits("violet");
  26.  
  27. echo "\n=========================\n";
  28.  
  29. function groupByColor($fruits){
  30.     return null;
  31. }
  32.  
  33. var_dump(groupByColor(["a1" => "a", "b1" => "b", "a2" => "a"]));
File Description
  • recruitment
  • PHP Code
  • 07 Sep-2022
  • 636 Bytes
You can Share it: