This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Thermostat | |
{ | |
public function thermostatController($switch,$temperature) | |
{ | |
if ($switch == "ON"){ | |
if ($temperature >= 23){ | |
return "OFF"; | |
}else{ | |
return "ON"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Thermostat | |
{ | |
public function thermostatController($switch,$temperature) | |
{ | |
if ($switch == "ON"){ | |
if ($temperature >= 23){ | |
return "OFF"; | |
}else{ | |
return "ON"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Thermostat | |
{ | |
public function thermostatController($switch,$temperature) | |
{ | |
if ($switch == "ON"){ | |
if ($temperature >= 23){ | |
return "OFF"; | |
}else{ | |
return "ON"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Thermostat | |
{ | |
public function thermostatController($switch,$temperature) | |
{ | |
if ($switch == "ON"){ | |
if ($temperature >= 23){ | |
return "OFF"; | |
}else{ | |
return "ON"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MergeNames | |
{ | |
public static function unique_names($array1, $array2) | |
{ | |
return array_unique(array_merge($array1,$array2)); | |
} | |
} | |
$names = MergeNames::unique_names(['Ava', 'Emma', 'Olivia'], ['Olivia', 'Sophia', 'Emma']); | |
echo join(', ', $names); // should print Emma, Olivia, Ava, Sophia |