Skip to content

statically call の日本語訳 #45

@mumumu

Description

@mumumu

static メソッドや static プロパティは、スコープ定義演算子で以下のようにアクセスする

<?php

class Test {
    public static int $prop = 1;
    public static function testMethod() : int { return 2; }
};

var_dump(Test::$prop);     //  1
var_dump(Test::testMethod());   //  2

上記の呼び方を statically call と呼んでいる箇所がかなりある。日本語版では「静的にコールする(呼び出す) 」と訳しているのだが、正直意味がわからない。静的にってどういうこと!? そのまま statically を置き換えただけである。

これについては、 (インスタンス化せずに)スコープ定義演算子を使ってアクセスする という意味なので、適切なタイミングで置き換える。

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions