Skip to content

Commit

Permalink
Fix example to avoid fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
robocoder authored Jan 3, 2025
1 parent 29fa2ce commit 005287a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ $decoded = JWT::decode($jwt, new Key($key, 'HS256'));
print_r($decoded);

// Pass a stdClass in as the third parameter to get the decoded header values
$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers = new stdClass());
$headers = new stdClass();
$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers);
print_r($headers);

/*
Expand Down

0 comments on commit 005287a

Please sign in to comment.