|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2021-04-12 08:45 UTC] nikic@php.net
 
-Status: Open
+Status: Not a bug
  [2021-04-12 08:45 UTC] nikic@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 22:00:01 2025 UTC | 
Description: ------------ When a function parameter has a non-nullable type hint, it is still possible to give it a default of null. Test script: --------------- function foo(string $foo = null) { var_dump($foo); } foo(); Expected result: ---------------- Fatal error: Cannot use null as default value for parameter $foo of type string Actual result: -------------- NULL