diff -u b/plugins/views/views_php_handler_field.inc b/plugins/views/views_php_handler_field.inc --- b/plugins/views/views_php_handler_field.inc +++ b/plugins/views/views_php_handler_field.inc @@ -183,11 +183,11 @@ } ob_start(); if ($this->php_click_sort_function_predefined) { - $result = (int)$function($this->view, $this, $this->php_static_variable, $normalized_row1, $normalized_row2); + $result = (int) $function($this->view, $this, $this->php_static_variable, $normalized_row1, $normalized_row2); } else { $closure = $function->getClosure(); - $result = (int)$closure($this->view, $this, $this->php_static_variable, $normalized_row1, $normalized_row2); + $result = (int) $closure($this->view, $this, $this->php_static_variable, $normalized_row1, $normalized_row2); } ob_end_clean(); } @@ -229,6 +229,7 @@ foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) { $normalized_row->$field = isset($values->{$handler->field_alias}) ? $values->{$handler->field_alias} : NULL; } + $function = $this->php_output_lamda_function; ob_start(); $closure = $function->getClosure(); diff -u b/plugins/views/views_php_handler_sort.inc b/plugins/views/views_php_handler_sort.inc --- b/plugins/views/views_php_handler_sort.inc +++ b/plugins/views/views_php_handler_sort.inc @@ -91,7 +91,7 @@ } } $closure = $function->getClosure(); - $result = (int)$closure($this->view, $this, $this->php_static_variable, $normalized_row1, $normalized_row2); + $result = (int) $closure($this->view, $this, $this->php_static_variable, $normalized_row1, $normalized_row2); return $factor * $result; } } diff -u b/views_php.module b/views_php.module --- b/views_php.module +++ b/views_php.module @@ -188,5 +188,4 @@ libraries_load('closure'); - $plain = \Opis\Closure\SerializableClosure::createClosure($args, $code); - $serializable = \Opis\Closure\SerializableClosure::from($plain); - return $serializable; + $closure = \Opis\Closure\SerializableClosure::createClosure($args, $code); + return new \Opis\Closure\SerializableClosure($closure); }