Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105091 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36928 invoked from network); 5 Apr 2019 10:33:28 -0000 Received: from unknown (HELO mail-ot1-f66.google.com) (209.85.210.66) by pb1.pair.com with SMTP; 5 Apr 2019 10:33:28 -0000 Received: by mail-ot1-f66.google.com with SMTP id t8so4769023otp.7 for ; Fri, 05 Apr 2019 00:29:18 -0700 (PDT) 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=LwQ5iDp8RhtxQn59FgBB6uDc3bKmtDtce5jRUnlcDAE=; b=ZMXgogkRigVbHLYueK+m3aCEViy8E8Gm2b/7hC8fSHfP/sF5roZfBYIpA4LoczM9Vk YoVAnw4+LU9P4u6cZI1fjq1gq/iqPl4u39wE+aQkdKYZeiTyabM8SjIrdnDsU3oh4IQV y2bGZT4OD0/umzWmht3VOHUtSCiW01rywEsiICF/Xq9ihFbHsDSV8ILlWb1iFS5idT7h zH1T1il2nvRNv5bZLCZNIzGhEoLjIBjbgJoExmen8DFDaslXgA5lzcAtsK2McHD/9tFI kBetPNI4w6ELSIAynYyN1mlooUwxKsdxc/WA3z//8DofgPBAbc6nSo8I6duNmQo5pQnr /O+g== X-Gm-Message-State: APjAAAWBxPm6bhv9A9uZYX5hZrbQdxmoj7PEDTyo1AGCZjEgaBIrgRMW 7GeP8hFmBTzFykTzpPRySzGWK9pqOCEPhpGEV2E= X-Google-Smtp-Source: APXvYqw4jaPi93UOQV4ax+rHOzOhuAjD1nLmUkEAwZJtTIT+A/v2aO4vIceJ5KPPPmSRc0r1AE7jKdgkHG3tAA7+xK0= X-Received: by 2002:a05:6830:94:: with SMTP id a20mr7516079oto.194.1554449358324; Fri, 05 Apr 2019 00:29:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 5 Apr 2019 03:29:07 -0400 Message-ID: To: Derick Rethans Cc: PHP Developers Mailing List , PHP Systems , Rasmus Lerdorf Content-Type: multipart/alternative; boundary="000000000000d3087d0585c371e7" Subject: Re: [PHP-DEV] Bug #77845 [Com]: Error in the comparaison (fwd) From: kalle@php.net (Kalle Sommer Nielsen) --000000000000d3087d0585c371e7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please do, it=E2=80=99s been long overdue tor. 4. apr. 2019 kl. 12.44 skrev Derick Rethans : > 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? > > 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=3Dbogofilter, spamicity=3D0.000000, version=3D1.2.4 > Subject: Bug #77845 [Com]: Error in the comparaison > > Edit report at https://bugs.php.net/bug.php?id=3D77845&edit=3D1 > > 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 =3D=3D=3D 0)` is evaluated as an expression before, meaning= that > essentially the `case` statement now looks like `case 1:`. The correct wa= y > 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 =3D 0 when using "switch" it can't be detected and if I used the > "if" it is working fine. > I tried with the "=3D=3D" and the "=3D=3D=3D" 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 =3D (integer)$test['id']; > > if ($id =3D=3D=3D 0 ) {return 1;} > > switch ($id) { > case ($id =3D=3D=3D 0): > return 2; > .... > > > > Expected result: > ---------------- > The expected result is the bloc inside the case ($id =3D=3D=3D0) is proce= ssed. > > Actual result: > -------------- > The actual result that it is passed for another case. > > > ------------------------------------------------------------------------ > > > > -- > Edit this bug report at https://bugs.php.net/bug.php?id=3D77845&edit=3D1 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- regards, Kalle Sommer Nielsen kalle@php.net --000000000000d3087d0585c371e7--