# Cannot get updated value of a static property inside a static method

**URL:** https://discourse.roots.io/t/cannot-get-updated-value-of-a-static-property-inside-a-static-method/12741
**Category:** sage
**Tags:** sage9
**Created:** 2018-06-21T21:01:09Z
**Posts:** 1

## Post 1 by @marcelo2605 — 2018-06-21T21:01:09Z

This is a simple example that what I’m trying to do:

```
class PageMake extends Controller {
  static $foo;

  public function generate(){
	Make::setFoo('test');
  }

  static function setFoo($value){
	self::$foo = $value;
  }

  static function create(){
	var_dump(self::$foo);
  }
}
```

I need to use the updated value if `$foo` inside `create()` method. I run an `error_log()` inside `setFoo()` and confirm that `$foo` was changed. But when I call it inside `create()` method, it return nothing.

I forgot to mention, `create()` is being used in filter.php:

```
add_action( 'wp_ajax_sendEmail', 'App\PageMake::create' );
add_action( 'wp_ajax_nopriv_sendEmail', 'App\PageMake::create' );
```

So maybe a was making a mistake. Because new `$foo` is not avaliable after page load, right?
