function apply_if_present($on) { if ($this->what !== NULL) { $what = $this->what; $on->{$what} = $this->val; $this->what = NULL; } }