Skip to content

Instantly share code, notes, and snippets.

@dajve
Last active March 19, 2018 12:16
Show Gist options
  • Save dajve/d6dd1b4604c175b696f215725250304b to your computer and use it in GitHub Desktop.
Save dajve/d6dd1b4604c175b696f215725250304b to your computer and use it in GitHub Desktop.
<?php
function pretRefuseAccord($age, $salaire)
{
switch (true) {
case $age >= 30 && $salaire < 20000 :
case $age > 40 && $salaire < 35000 :
case $age > 50 && $salaire < 50000 :
$return = true;
break;
default :
$return = false;
break;
}
}
$resultat = pretRefuseAccord(20, 27000);
var_dump($resultat);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment