FICA_test - 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 FICA_test.php

  1. <?php
  2. $WH = 100; // worked hours
  3. $TP = 500.00; // tips
  4. $GW = 375.00; // gross wages
  5. $MW = 5.15; // minimum wage rate
  6.  
  7. // Payrate
  8. $a = $GW / $WH;
  9.  
  10. // FICA Tip...
  11. $b = $WH * $MW;
  12.  
  13. // Social Security Wages
  14. $c = $GW;
  15.  
  16. // Tips needed...
  17. if($c > 0) {
  18.  if($b > $c) {
  19.    if($TP > ($b - $c)) {
  20.     $d = $b - $c;
  21.    } else {
  22.     $d = 0;  
  23.    }        
  24.   } else {
  25.    $d = 0;  
  26.   }        
  27. } elseif($b < $c) {
  28.   if($TP < ($b - $c)) {
  29.    $d = $b - $c;
  30.   } else {
  31.    $d = 0;
  32.   }
  33. }  
  34.  
  35. // Tips Subject...
  36. if($c > 0) {
  37.   if(($TP - $d) > 0) {
  38.    $e = $TP - $d;
  39.   } else {
  40.    $e = 0;
  41.   }
  42. } elseif(($TP + $d) < 0) {
  43.    $e = $TP - $d;
  44. } else {
  45.    $e = 0;
  46. }
  47.  
  48. // Test
  49. if($TP == 0) {
  50.  $x = ((7.25 * $WH) - $GW);
  51. } elseif(($TP + $GW) > (7.25 * $WH)) {
  52.  $x = 0;  
  53. } else {
  54.  $x = ((7.25 * $WH) - ($TP + $GW));
  55. }  
  56.   
  57.  
  58.  
  59.  
  60. echo 'Gross Wages: $'.$GW.'<br>';
  61. echo 'Worked Hours: '.$WH.'<br>';
  62. echo 'Tips: $'.$TP.'<br>';
  63. echo 'Payrate: $'.$a.'<br>';
  64. echo 'Minimum Wage: $'.$MW.'<br>';
  65. echo '----------------------<br>';
  66. echo 'FICA Tip Minimum Wage Requirement: $'.$b.'<br>';
  67. echo 'Social Security Wages: $'.$c.'<br>';
  68. echo 'Tips Needed for Minimum Social Security: $'.$d.'<br>';
  69. echo 'Tips Subject to Security Tip Credit: $'.$x.'<br>';
  70.  
File Description
  • FICA_test
  • PHP Code
  • 19 Feb-2019
  • 1.17 Kb
You can Share it: