5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHP で (a == 1 && a == 2 && a == 3) を常に真(true)にできますか?

Last updated at Posted at 2018-01-23

表題の例のアレを PHP でチャレンジ

TL;DR

sample.php
<?php

const a = true;

if(a == 1 && a == 2 && a == 3){
    echo 'True';
}else{
    echo 'False';
}

チートっぽいですが、ヨーダ記法のつもりで見ればアリかしら?カタカタ型くるしいこと言わずに楽しんでみました。

PoC(概念実証)はこちら

所感

マストドンのタイムラインで盛り上がってるなと思ったら、StackOverflow から始まったみたいですね。自分も Qiitadon にトゥートしていたので Qiita にも掲載。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?