PHP code example of bherila / us-tax-advantaged-params
1. Go to this page and download the library: Download bherila/us-tax-advantaged-params library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bherila / us-tax-advantaged-params example snippets
declare(strict_types=1);
ntType;
use USTaxAdvantagedParams\FilingStatus;
use USTaxAdvantagedParams\PersonBuilder;
use USTaxAdvantagedParams\AccountBuilder;
use USTaxAdvantagedParams\USTaxAdvantagedParams as TaxAdvantagedParams;
$result = TaxAdvantagedParams::forTaxYear(2026)
->filingStatus(FilingStatus::MARRIED_FILING_JOINTLY)
->taxpayer('taxpayer', static function (PersonBuilder $person): void {
$person
->bornIn(1963)
->iraCompensation(180_000)
->w2Compensation(180_000)
->rothIraMagi(240_000)
->traditionalIraDeductionMagi(240_000)
->coveredByEmployerPlan(true)
->priorYearFicaWages('employer-a', 180_000);
})
->spouse('spouse', static function (PersonBuilder $person): void {
$person
->bornIn(1970)
->iraCompensation(0)
->rothIraMagi(240_000)
->traditionalIraDeductionMagi(240_000)
->coveredByEmployerPlan(false);
})
->account(
'taxpayer-401k',
'taxpayer',
AccountType::TRADITIONAL_401K,
static function (AccountBuilder $account): void {
$account
->employer('employer-a')
->annualAdditionsGroup('employer-a')
->planCompensation(180_000)
->permitsRothContributions()
->permitsRothCatchUp()
->permitsAfterTaxContributions()
->expectedEmployerContribution(9_000)
->priority(10);
},
)
->account('spouse-ira', 'spouse', AccountType::TRADITIONAL_IRA)
->calculate();
var_dump($result['totals']);