1
0

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.

関数名とクラス名が被っても大丈夫

Posted at

ふと疑問に思ったので試してみた。

関数名とクラス名が被っても大丈夫。

<?php
function zz()
{
    return "hoge";
}

class zz
{
    public static function xx()
    {
        return __METHOD__;
    }
}

var_dump(zz());
var_dump(new zz());
var_dump(zz::xx());
string(4) "hoge"
class zz#1 (0) {
}
string(6) "zz::xx"

やらないけど。

1
0
9

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?