|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-02-22 16:53 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2017-02-22 16:53 UTC] requinix@php.net
[2017-02-22 17:04 UTC] aaatoja at o2 dot pl
[2017-02-22 17:23 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Description: ------------ Shouldn't code below throw TypeError exception: Argument 1 passed to test::a() must be of the type string, null given? Nullable type is not allowed here. This should work only with a(?string $x=null) Test script: --------------- class test { public function a(string $x=null) { echo 'a'; } } $x = new test; $x->a(null); Expected result: ---------------- TypeError exception Actual result: -------------- Null value as an argument is accepted.