Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105093 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42101 invoked from network); 5 Apr 2019 10:44:32 -0000 Received: from unknown (HELO mail-it1-f169.google.com) (209.85.166.169) by pb1.pair.com with SMTP; 5 Apr 2019 10:44:32 -0000 Received: by mail-it1-f169.google.com with SMTP id k64so7997890itb.5 for ; Fri, 05 Apr 2019 00:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tPvRB6uqdMIMWs84OaEwnLLsWu46wJc/vDjNN0njKBs=; b=vOtL3JsLNkXhUQTOSVgQRKHN8lM92uGRiGkl3ayr6jy6A8aecA92yyGzEHQsBjgvS/ f3bh8l0zJo8x87wUjewyiZ55l3xU+RPK+n06M8H2jG6yezLrxVcC+eiwHubhzVuGd8sE 98Pghj47YGFW6X1oA0uGvVIKQ9DFv3I9wjA7hbPUPwNT330KAO/rRlFyst0fpMP8ZRWf 1mVuQj9P00izGPKyx+6WKKaFlgkAlKTm35kq8ofJpMvgsf+fnWfhB404wBjxFKJMAJI/ soSh9ExGoQhY4AkzMAjwjl/DVADw0yL7/M8zm3wbzXqdMyWA0oc6emTrhRkQku7YagAC zc/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tPvRB6uqdMIMWs84OaEwnLLsWu46wJc/vDjNN0njKBs=; b=ZKll6OpK58LIUzWCi2kA4G0EPnaciuJe5GxgI22m++bHjmi03OW36PuceqDonlRk8L /dNBOWlg7se3QNBT+8se63q3s10X+QUATTtk9YsACgE5VyPKeFV6tkMc2kZJNT+wZAIQ LbjiVU2HzH1Tu5aeISXW0J0QRXhXr5KezbalwG9fQR1SsVUEiDT34azo4kpNW/DMOGoH +aoNBt0bey2t56SrUY3YVe0MHyqOJVuiGGYw8fa2TE1vDXEyxP0QlJu5kmoZcmrnNuyk wK4fDZXAiMcOYTxZCa+OGV4wq/t7ZQ5cDf5YrtM5q+i9yActPcayOXEHpFT03tdUlS27 ZlPQ== X-Gm-Message-State: APjAAAWkzDTaEtRyhQHUvv45C1+PC7h9RYcgTL2moKeSoV8QhtOv5cv/ Fal3VZfroO8nN5aCE5G/ogbxYE6VRm5VH1pZwjBis4iMJWI= X-Google-Smtp-Source: APXvYqz7FzwOlubL2iF0CVyQ8+czvc9Ze73LGteTPRx1QUPvcNHII6P/puigYS66Vp4cHgn4Z48yi68/fyh1eAisWFE= X-Received: by 2002:a24:9197:: with SMTP id i145mr7828603ite.117.1554450022456; Fri, 05 Apr 2019 00:40:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 5 Apr 2019 09:40:05 +0200 Message-ID: To: Derick Rethans Cc: PHP Developers Mailing List , PHP Systems , Rasmus Lerdorf Content-Type: multipart/alternative; boundary="00000000000068e16d0585c39938" Subject: Re: [PHP-DEV] Bug #77845 [Com]: Error in the comparaison (fwd) From: nikita.ppv@gmail.com (Nikita Popov) --00000000000068e16d0585c39938 Content-Type: text/plain; charset="UTF-8" On Thu, Apr 4, 2019 at 6:44 PM Derick Rethans wrote: > Hey, > > We have banned this "spam2" user from internals, but he's still being an > ass on the bug system. Should I have a look at whether we can get him > out of there as well? > Yes, please. The only reason he is not banned on bugs.php.net is that, as far as I'm aware, we don't really have a good method to do that with the bug tracker not requiring accounts. Nikita cheers, > Derick > > -- > https://derickrethans.nl | https://xdebug.org | https://dram.io > Like Xdebug? Consider a donation: https://xdebug.org/donate.php, > or become my Patron: https://www.patreon.com/derickr > twitter: @derickr and @xdebug > > ---------- Forwarded message ---------- > Date: Thu, 04 Apr 2019 14:37:14 +0000 > From: spam2 at rhsoft dot net > To: php-bugs@lists.php.net > X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=1.2.4 > Subject: Bug #77845 [Com]: Error in the comparaison > > Edit report at https://bugs.php.net/bug.php?id=77845&edit=1 > > ID: 77845 > Comment by: spam2 at rhsoft dot net > Reported by: baklouti dot med at gmail dot com > Summary: Error in the comparaison > Status: Not a bug > Type: Bug > Package: *Compile Issues > Operating System: ubuntu 18.04 > PHP Version: 7.2.16 > Block user comment: N > Private report: N > > New Comment: > > hell post the code you are actually using instead f**g decriptions ike " > am not using the two cases in the same time" - switch works, full stop, > echo what $id contains really at that moment > > > Previous Comments: > ------------------------------------------------------------------------ > [2019-04-04 14:34:18] baklouti dot med at gmail dot com > > Yes, I try it with "case 0:" , and the same issue is happening. > > ------------------------------------------------------------------------ > [2019-04-04 11:21:37] kalle@php.net > > Because `($id === 0)` is evaluated as an expression before, meaning that > essentially the `case` statement now looks like `case 1:`. The correct way > to do that which you are trying to would be to make your case statement > simply look like `case 0:`. > > Please refer to the documentation int the future: > https://www.php.net/manual/en/control-structures.switch.php > > ------------------------------------------------------------------------ > [2019-04-04 11:10:25] baklouti dot med at gmail dot com > > Description: > ------------ > I am testing the value of $id to do some processing. I retrieve the > variable $id from an array ($test) and converted to integer, for the case > that $id = 0 when using "switch" it can't be detected and if I used the > "if" it is working fine. > I tried with the "==" and the "===" and also not working with "switch". > I am not using the two cases in the same time, i tested the "if" and > "switch" > separately. > > $id = (integer)$test['id']; > > if ($id === 0 ) {return 1;} > > switch ($id) { > case ($id === 0): > return 2; > .... > > > > Expected result: > ---------------- > The expected result is the bloc inside the case ($id ===0) is processed. > > Actual result: > -------------- > The actual result that it is passed for another case. > > > ------------------------------------------------------------------------ > > > > -- > Edit this bug report at https://bugs.php.net/bug.php?id=77845&edit=1 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --00000000000068e16d0585c39938--