<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>iww</author_name>
  <author_url>https://blog.hatena.ne.jp/iww/</author_url>
  <blog_title>揮発性のメモ２</blog_title>
  <blog_url>https://iww.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>ランキング参加中プログラミングランキング参加中PHP a.php &lt;?php $SETTING = [1,2,3]; b.php #!/usr/bin/php -q &lt;?php require_once &quot;a.php&quot;; echo $SETTING[0]; このとき、普通に b.php を実行するとちゃんと 1 が出力される。a.phpで定義した変数が正しく認識されている。しかし、PhpStormでは 未定義です とか言ってエラー扱いになる。 なんでだよ 回避策は、（本来は無駄で無意味だが） global 宣言を書いてしまう b2.php #!/usr/bin/php -q &lt;?php req…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fiww.hateblo.jp%2Fentry%2F20241008%2Fglobal&quot; title=&quot;phpで、requireの中で定義した変数をglobalでglobalに使う - 揮発性のメモ２&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>https://cdn.user.blog.st-hatena.com/default_entry_og_image/42132/1685946694840016</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-10-08 00:00:00</published>
  <title>phpで、requireの中で定義した変数をglobalでglobalに使う</title>
  <type>rich</type>
  <url>https://iww.hateblo.jp/entry/20241008/global</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
