[GH-ISSUE #90] Default value for parameters with a class type hint can only be NULL #506

Closed
opened 2026-03-14 11:59:54 +03:00 by kerem · 4 comments
Owner

Originally created by @binitghetiya on GitHub (Dec 12, 2017).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/90

Laravel 5.4 Php 5.6

$user = User::first();
$google2fa = new Google2FA();
$code_from_app = "332117";

$valid = $google2fa->verifyKey($user->google2fa_secret, $code_from_app);

Throwing error : Default value for parameters with a class type hint can only be NULL

selection_080

I had some search and found that php-cs-fixer issue it requires PHP 7.1 but i haven't used that and for this library min PHP version require is 5.4 So, please look into this issue.

Thanks

Originally created by @binitghetiya on GitHub (Dec 12, 2017). Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/90 Laravel 5.4 Php 5.6 $user = User::first(); $google2fa = new Google2FA(); $code_from_app = "332117"; $valid = $google2fa->verifyKey($user->google2fa_secret, $code_from_app); Throwing error : **_Default value for parameters with a class type hint can only be NULL_** ![selection_080](https://user-images.githubusercontent.com/14307119/33868830-58ac2320-df2b-11e7-94a2-88afe2baead4.png) I had some search and found that php-cs-fixer issue it requires PHP 7.1 but i haven't used that and for this library min PHP version require is 5.4 So, please look into this issue. Thanks
kerem closed this issue 2026-03-14 11:59:59 +03:00
Author
Owner

@csrDev369 commented on GitHub (Feb 23, 2018):

Any update on this? I have the same problem but working locally with php v5.6.25 work perfect but on production server, same php version I get the same error:

(1/1) FatalErrorExceptionDefault value for parameters with a class type hint can only be NULL

in Base32.php (line 43)

I'm using laravel 5.4...

<!-- gh-comment-id:368164870 --> @csrDev369 commented on GitHub (Feb 23, 2018): Any update on this? I have the same problem but working locally with php v5.6.25 work perfect but on production server, same php version I get the same error: (1/1) FatalErrorExceptionDefault value for parameters with a class type hint can only be NULL -- in Base32.php (line 43) I'm using laravel 5.4...
Author
Owner

@antonioribeiro commented on GitHub (Mar 7, 2018):

I need more information on this, because there are no type hints, code has 100% tests coverage and is passing even on PHP 5.4:

image

<!-- gh-comment-id:371237999 --> @antonioribeiro commented on GitHub (Mar 7, 2018): I need more information on this, because there are no type hints, code has 100% tests coverage and is passing even on PHP 5.4: ![image](https://user-images.githubusercontent.com/3182864/37110875-ec511034-221c-11e8-9188-dfd2545852ea.png)
Author
Owner

@dingxiangjun commented on GitHub (Apr 8, 2018):

Default value for parameters with a class type hint can only be NULL
FatalErrorException in Base32.php line 43:
I'm using laravel 5.0
I'm using php 5.6.25

<!-- gh-comment-id:379524226 --> @dingxiangjun commented on GitHub (Apr 8, 2018): Default value for parameters with a class type hint can only be NULL FatalErrorException in Base32.php line 43: I'm using laravel 5.0 I'm using php 5.6.25
Author
Owner

@maximedeoliveira commented on GitHub (Jun 18, 2018):

Got this error too : Default value for parameters with a class type hint can only be NULL in vendor\paragonie\constant_time_encoding\src\Base32.php on line 43
PHP 5.5

Anyone got a fix ?

<!-- gh-comment-id:398074347 --> @maximedeoliveira commented on GitHub (Jun 18, 2018): Got this error too : Default value for parameters with a class type hint can only be NULL in vendor\paragonie\constant_time_encoding\src\Base32.php on line 43 PHP 5.5 Anyone got a fix ?
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/google2fa#506
No description provided.