<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tanakahisateru</author_name>
  <author_url>https://blog.hatena.ne.jp/tanakahisateru/</author_url>
  <blog_title>なんたらノート第三期ベータ</blog_title>
  <blog_url>https://tanakahisateru.hatenablog.jp/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>PHPの new は、オブジェクト生成後、変数に格納してからでないとそのメソッドが呼べません。ああダサいダサい。 &lt;?php (new MyClass())-&gt;myMethod(); //構文エラー $tmp = new MyClass(); $tmp-&gt;myMethod(); //こうしないといけない ?&gt; あと、どこで競合するかわからない__autoloadとか、いつ登録解除したらいいのかわからないSPLのオートロード登録とか…萎えまくりです。というわけで、すぐにメソッドを呼べて、しかも、もっとカジュアルで環境破壊のない手段をとることにしました。 &lt;?php function newobj…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanakahisateru.hatenablog.jp%2Fentry%2F20090901%2F1251796587&quot; title=&quot;PHPのnewはこれで置き換えだ - なんたらノート第三期ベータ&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>2009-09-01 18:16:27</published>
  <title>PHPのnewはこれで置き換えだ</title>
  <type>rich</type>
  <url>https://tanakahisateru.hatenablog.jp/entry/20090901/1251796587</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
