Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121526 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6623 invoked from network); 30 Oct 2023 15:21:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Oct 2023 15:21:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3185180539 for ; Mon, 30 Oct 2023 08:21:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 30 Oct 2023 08:21:22 -0700 (PDT) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-28039ee1587so944851a91.2 for ; Mon, 30 Oct 2023 08:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698679281; x=1699284081; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NqIqujYsZ2S0ard38nyP33k0Mjm7ytm6t2SmFkrI0vw=; b=cqHWlXu0hEFPGK+sJdpexUh7TW3ahr9oWvDGwdVyn7uZ1tHmae0MMTMCyOCgzCbcpH LbkjhkxxmVRmU0IitVD9j3CYkOX9hnSUMqatCMFF+k/JrjbpuxVrO7gTdexx0auw1gtj KPeArC0H1Iu/COcX01eZ7V9/8nHeIUe0ZXmbWKiiLlNjCr6DGycy0s55VnuJqyQq1IOM pv0QomHrw08yO8DizVae6U2h4irblg7/uNPnUE3uq2E4nsTVAp6lA3Lm+HBCt0sCMoSI x9Vfes9DWfbmoU82lM8yRBdoJD+/kt8nHfhRY315iNIpo1nBq6OXOyTQ+XreDEONglLl pZQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698679281; x=1699284081; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NqIqujYsZ2S0ard38nyP33k0Mjm7ytm6t2SmFkrI0vw=; b=KvG86fAtuXigGRvNWJBeS2WSDyppSnPXJEbRlK6AARlr5NAiT7jJ2Y2D92kYmN6oje J1B8TKBWbENZLFYy8A7y1DHBSvR54b9l8TE8fhEHBQMNLNsqwdixwy3AU35MPlPLtxed 0qa1c3SdbnUTVrRtK2Y0ckB6pDHeNvqLbVhjTcurIMwd9bYwNxpeoosL2rmAab9hn0vs rovH2xsBClu88qQ33sSLhG9mLGKp0faft31kwok75ehEviuvUURQGGn9k51M4OrP8hhT cs9+W/HbMJ+Bk1AiOoqOic+I8mDygeqWvJ0aDn8Kz15VnNDkClCp9V5jZ/+kpvtV3Hj0 nVgg== X-Gm-Message-State: AOJu0Yz3iXwWrqQK32FHSGggPMHTCjKVLfUpTUFYBO91xe9PQNwO4yUP h6/JULT6YJhURJsuIpH34GvwrqOPj5frU4inn34= X-Google-Smtp-Source: AGHT+IGCoBFQlwszgVt2s2I0mTWBy3PpKARF0/JyICuCIU+fGfIISQ0nxRI5hZP1O8gjnw1rPFa0JaEL7OCzVDpNXyU= X-Received: by 2002:a17:90a:9906:b0:280:65ed:dfe with SMTP id b6-20020a17090a990600b0028065ed0dfemr2262807pjp.23.1698679281161; Mon, 30 Oct 2023 08:21:21 -0700 (PDT) MIME-Version: 1.0 References: <22ad21cc-f6ba-49e9-b1a9-8c73fe173648@gmail.com> In-Reply-To: <22ad21cc-f6ba-49e9-b1a9-8c73fe173648@gmail.com> Date: Mon, 30 Oct 2023 15:21:09 +0000 Message-ID: To: Marcos Marcolin Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000024208e0608f09707" Subject: Re: [PHP-DEV] New RFC : empty() function From: fenniclog@gmail.com (tag Knife) --00000000000024208e0608f09707 Content-Type: text/plain; charset="UTF-8" > > However, according to my example, the variable is defined and has its > value as 0 or false, and empty() returns true anyway. I confess that > I've had some problems like this, and we chose not to use empty(), as > sometimes 0 or false makes sense as a valid value. > That is exactly as the documentation explains it. empty is to check if a variable is not holding a usable value. 0, false, true are all valid values and show the variable is not empty. The purpose for empty is to check for undefined variables, empty arrays or empty strings. eg. "", [], null or undefined. --00000000000024208e0608f09707--