ext-php-rs icon indicating copy to clipboard operation
ext-php-rs copied to clipboard

Static property and method

Open arshidkv12 opened this issue 2 years ago • 2 comments

How to add static property and method?

    pub fn hello( q: String) -> String {
        format!("hello {}", q)
    }

arshidkv12 avatar Jul 16 '23 14:07 arshidkv12

@arshidkv12 I believe just that should work for static methods. From the docs:

Class methods can take a &self or &mut self parameter. They cannot take a consuming self parameter. Static methods can omit this self parameter.

joehoyle avatar Jul 19 '23 10:07 joehoyle

I want code as follows.

PHP

class my class{

  static $a = 1;
  public static function hello(){

  }
}

arshidkv12 avatar Jul 19 '23 10:07 arshidkv12