|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-09-14 15:23 UTC] daverandom@php.net
-Status: Open
+Status: Not a bug
[2017-09-14 15:23 UTC] daverandom@php.net
[2017-09-14 15:25 UTC] daverandom@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 19:00:01 2026 UTC |
Description: ------------ $hash = null; $hash ?? 'test'; // output 'test' $hash = ''; $hash ?? 'test'; // output '' - WHY???? $hash = ""; !$hash ? 'test' : $hash; // output 'test' Test script: --------------- $hash = null; $hash ?? 'test'; // output 'test' $hash = ''; $hash ?? 'test'; // output '' - WHY???? $hash = ""; !$hash ? 'test' : $hash; // output 'test' Expected result: ---------------- $hash = null; $hash ?? 'test'; // output 'test' $hash = ''; $hash ?? 'test'; // output 'test' - it's normal $hash = ""; !$hash ? 'test' : $hash; // output 'test'