3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUserConsentsByUid(string $uid, array $filters = [], ?int $limit) { var_dump($limit); } getUserConsentsByUid('uid', []);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Optional parameter $filters declared before required parameter $limit is implicitly treated as a required parameter in /in/UqHLj on line 3 Fatal error: Uncaught ArgumentCountError: Too few arguments to function getUserConsentsByUid(), 2 passed in /in/UqHLj on line 9 and exactly 3 expected in /in/UqHLj:3 Stack trace: #0 /in/UqHLj(9): getUserConsentsByUid('uid', Array) #1 {main} thrown in /in/UqHLj on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Deprecated: Required parameter $limit follows optional parameter $filters in /in/UqHLj on line 3 Fatal error: Uncaught ArgumentCountError: Too few arguments to function getUserConsentsByUid(), 2 passed in /in/UqHLj on line 9 and exactly 3 expected in /in/UqHLj:3 Stack trace: #0 /in/UqHLj(9): getUserConsentsByUid('uid', Array) #1 {main} thrown in /in/UqHLj on line 3
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught ArgumentCountError: Too few arguments to function getUserConsentsByUid(), 2 passed in /in/UqHLj on line 9 and exactly 3 expected in /in/UqHLj:3 Stack trace: #0 /in/UqHLj(9): getUserConsentsByUid('uid', Array) #1 {main} thrown in /in/UqHLj on line 3
Process exited with code 255.
Output for 5.6.38, 7.0.33
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /in/UqHLj on line 3
Process exited with code 255.

preferences:
131.81 ms | 401 KiB | 175 Q