Skip to content

Commit d9a140a

Browse files
authored
docs: fix example to avoid fatal error (#590)
1 parent 29fa2ce commit d9a140a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ $decoded = JWT::decode($jwt, new Key($key, 'HS256'));
4848
print_r($decoded);
4949

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

5455
/*

0 commit comments

Comments
 (0)