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 | |
function validateApplicationUntangled($user) { | |
if($user->age<18) { | |
printf("Sorry, but the user %s is under 18\n", $user->name); | |
return false; | |
} | |
if($user->hasPreviousApplication && $user->previousApplicationApproved) { | |
printf("Sorry, but the user %s has a previously approved application\n", $user->name); | |
return false; |
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 | |
function validateApplicationTangled($user) { | |
if($user->age>18) { | |
if(($user->hasPreviousApplication && !$user->previousApplicationApproved) || !$user->hasPreviousApplication) { | |
printf("Cool, application approved for user %s\n", $user->name); | |
return true; | |
} else { | |
printf("Sorry, but the user %s has a previously approved application\n", $user->name); | |
return false; | |
} |
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 | |
function validateApplicationTangled($user) { | |
if($user->age>18) { | |
if(($user->hasPreviousApplication && !$user->previousApplicationApproved) || !$user->hasPreviousApplication) { | |
printf("Cool, application approved for user %s\n", $user->name); | |
return true; | |
} else { | |
printf("Sorry, but the user %s has a previously approved application\n", $user->name); | |
return false; | |
} |
NewerOlder