<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shigemk2</author_name>
  <author_url>https://blog.hatena.ne.jp/shigemk2/</author_url>
  <blog_title>by shigemk2</blog_title>
  <blog_url>https://www.shigemk2.com/</blog_url>
  <categories>
    <anon>php</anon>
    <anon>Ruby</anon>
  </categories>
  <description>ループの中で変数を定義するしたら、 次のループのときに変数は定義されているのだろうか。 やってみた。 &lt;?php for ($i = 0; $i &lt; 3; $i++) { if (isset($p)) { echo 'hoge' . &quot;\n&quot;; } $p = $i; if (isset($p)) { echo 'hoge' . &quot;\n&quot;; } } ?&gt; hoge hoge hoge hoge hoge i = 0 while i &lt; 3 p defined?(a) a = i i += 1 p defined?(a) end nil &quot;local-variable&quot; nil &quot;local-va…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.shigemk2.com%2Fentry%2F20120131%2F1328005329&quot; title=&quot;ループ内で宣言された変数の行方 - by shigemk2&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-01-31 19:22:09</published>
  <title>ループ内で宣言された変数の行方</title>
  <type>rich</type>
  <url>https://www.shigemk2.com/entry/20120131/1328005329</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
