summaryrefslogtreecommitdiffhomepage
path: root/services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-06-27 23:39:31 +0900
committernsfisis <nsfisis@gmail.com>2025-06-27 23:39:31 +0900
commit674fe965550444db87edc7937ff6932e1a918d9d (patch)
treee8a80dd958d3e082485286bf5785a7992b6e6b0e /services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html
parentfe4d1d625b53796c5f20399790e5ff8c7a7e1608 (diff)
downloadnsfisis.dev-674fe965550444db87edc7937ff6932e1a918d9d.tar.gz
nsfisis.dev-674fe965550444db87edc7937ff6932e1a918d9d.tar.zst
nsfisis.dev-674fe965550444db87edc7937ff6932e1a918d9d.zip
feat(meta): rename vhosts/ directory to services/
Diffstat (limited to 'services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html')
-rw-r--r--services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html215
1 files changed, 215 insertions, 0 deletions
diff --git a/services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html b/services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html
new file mode 100644
index 00000000..551a3700
--- /dev/null
+++ b/services/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。">
+ <meta name="keywords" content="PHP,PHPerKaigi">
+ <meta property="og:type" content="article">
+ <meta property="og:title" content="PHPerKaigi 2023: ボツになったトークン問題 その 2|REPL: Rest-Eat-Program Loop">
+ <meta property="og:description" content="来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。">
+ <meta property="og:site_name" content="REPL: Rest-Eat-Program Loop">
+ <meta property="og:locale" content="ja_JP">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 2|REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=9513229b52eb2041b99ba1b959305633">
+ </head>
+ <body class="single">
+ <header class="header">
+ <div class="site-logo">
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </div>
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2023: ボツになったトークン問題 その 2</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section id="changelog">
+ <h2><a href="#changelog">更新履歴</a></h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-11-19">2022-11-19</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の <a href="https://phperkaigi.jp/2023/" rel="noreferrer" target="_blank">PHPerKaigi 2023</a> において、昨年と同様に、弊社 <a href="https://www.dgcircus.com/" rel="noreferrer" target="_blank">デジタルサーカス株式会社</a> からトークン問題を出題予定である。
+ </p>
+ <p>
+ 昨年のトークン問題の記事はこちら: <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">PHPerKaigi 2022 トークン問題の解説</a>
+ </p>
+ <p>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </p>
+ <p>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ)。
+ </p>
+ <p>
+ その 1 はこちら: <a href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">PHPerKaigi 2023: ボツになったトークン問題 その 1</a>
+ </p>
+ </section>
+ <section id="section--quiz">
+ <h2><a href="#section--quiz">問題</a></h2>
+ <p>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span></code></pre>
+ </div>
+ <p>
+ “And Then There Were None” (そして誰もいなくなった) と名付けた作品。変則 quine (自分自身と同じソースコードを出力するプログラム) になっている。
+ </p>
+ </section>
+ <section id="section--how-to-obtain-token">
+ <h2><a href="#section--how-to-obtain-token">トークン入手方法</a></h2>
+ <p>
+ 実行してみると、次のような出力が得られる。
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#6A737D">#</span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span></code></pre>
+ </div>
+ <p>
+ 1 行目を除き、先ほどのコードとほぼ同じものが出てきた。もう一度実行してみる。
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#6A737D">#</span></span>
+<span class="line"><span style="color:#005CC5">W</span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span>
+<span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"​"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span></code></pre>
+ </div>
+ <p>
+ 今度は 2 行目が書き換えられた。すべての行が変化するまで繰り返すと次のようになる。
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#6A737D">#</span></span>
+<span class="line"><span style="color:#005CC5">W</span></span>
+<span class="line"><span style="color:#005CC5">E</span></span>
+<span class="line"><span style="color:#005CC5">L</span></span>
+<span class="line"><span style="color:#005CC5">O</span></span>
+<span class="line"><span style="color:#005CC5">V</span></span>
+<span class="line"><span style="color:#005CC5">E</span></span>
+<span class="line"><span style="color:#005CC5">P</span></span>
+<span class="line"><span style="color:#005CC5">H</span></span>
+<span class="line"><span style="color:#005CC5">P</span></span></code></pre>
+ </div>
+ <p>
+ トークン「#WELOVEPHP」が手に入った。
+ </p>
+ </section>
+ <section id="section--commentary">
+ <h2><a href="#section--commentary">解説</a></h2>
+ <p>
+ 一見すると同じ行が 10 行並んでいるだけなのにも関わらず、なぜそれぞれの行で出力が変わるのか。ソースコードをコピーして、適当なエディタに貼り付けるとわかりやすい。
+ </p>
+ <p>
+ Vim で開くと次のようになる (1 行目を抜粋)。
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#D73A49">&#x3C;?</span><span style="color:#005CC5">php</span><span style="color:#005CC5"> printf</span><span style="color:#24292E">((</span><span style="color:#005CC5">isset</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">?fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">trim</span><span style="color:#24292E">($s,</span><span style="color:#032F62">"&#x3C;200b>"</span><span style="color:#24292E">)</span><span style="color:#D73A49">:fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">))($s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'&#x3C;200b>&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"&#x3C;200b>"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span><span style="color:#24292E">)</span><span style="color:#D73A49">.</span><span style="color:#032F62">"</span><span style="color:#005CC5">\n</span><span style="color:#032F62">"</span><span style="color:#24292E">,</span><span style="color:#032F62">"</span><span style="color:#005CC5">\x27</span><span style="color:#24292E">$s</span><span style="color:#005CC5">\x27</span><span style="color:#032F62">"</span><span style="color:#24292E">);</span><span style="color:#D73A49">?></span></span></code></pre>
+ </div>
+ <p>
+ <code>&lt;200b&gt;</code> と表示されているのは、Unicode の U+200b で、ゼロ幅スペースである。
+ </p>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ <p>
+ エディタによっては、ゼロ幅スペースが見えないことがある。VSCode ではブラウザと同様に不可視だった。
+ </p>
+ </div>
+ </div>
+ <p>
+ 文字列リテラルの中にゼロ幅スペースを仕込むことで、見た目を変えずに情報をエンコードすることが可能となる。
+ </p>
+ <p>
+ 続いて、トークンへの変換ロジックを解析する。注目すべきはこの部分だ。以下、ゼロ幅スペースは Vim での表示に合わせて <code>&lt;200b&gt;</code> と記載する。
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#D73A49">fn</span><span style="color:#24292E">($s)=></span><span style="color:#005CC5">chr</span><span style="color:#24292E">(</span><span style="color:#005CC5">strlen</span><span style="color:#24292E">($s)</span><span style="color:#D73A49">/</span><span style="color:#005CC5">3</span><span style="color:#24292E">)</span></span></code></pre>
+ </div>
+ <p>
+ PHP の <code>strlen()</code> は文字列のバイト数を返す。1 行目の <code>$s</code> は以下の内容となっており、
+ </p>
+ <div class="codeblock">
+ <pre class="shiki github-light" style="background-color:#f5f5f5;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#24292E">$s</span><span style="color:#D73A49">=</span><span style="color:#032F62">'&#x3C;200b>&#x3C;?php printf((isset($s)?fn($s)=>trim($s,"&#x3C;200b>"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'</span></span></code></pre>
+ </div>
+ <p>
+ このソースコードは UTF-8 で書かれているので、105 バイトになる。それを 3 で割ると 35 となり、これは <code>#</code> の ASCII コードと一致する。他の行も、同様にしてゼロ幅スペースを詰めることで文字列長を調整し、トークンをエンコードしている。
+ </p>
+ <p>
+ デコード部以外の部分は、quine のための記述である。
+ </p>
+ </section>
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ <a href="https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html" rel="noreferrer" target="_blank">CVE-2021-42574</a> に着想を得た作品。この脆弱性は、Unicode の制御文字である left-to-right mark と right-to-left mark を利用し、ソースコードの実際の内容を欺く、というもの。簡単のためゼロ幅スペースを用いることとし、ついでに quine にもするとこうなった。
+ </p>
+ <p>
+ ボツになった理由は、ゼロ幅スペースを表示してくるエディタが想像以上に多かったため。「同じ行が並んでいるだけなのに出力が異なる」というアイデアの根幹を崩されてしまうので、この問題は不採用となった。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>