diff --git a/plugins/views/views_php_handler_field.inc b/plugins/views/views_php_handler_field.inc
index 1da366b..1e1a629 100644
--- a/plugins/views/views_php_handler_field.inc
+++ b/plugins/views/views_php_handler_field.inc
@@ -114,7 +114,7 @@ class views_php_handler_field extends views_handler_field {
   function php_pre_execute() {
     // Ecexute static PHP code.
     if (!empty($this->options['php_setup'])) {
-      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
+      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . "\n;");
       ob_start();
       $function($this->view, $this, $this->php_static_variable);
       ob_end_clean();
@@ -128,7 +128,7 @@ class views_php_handler_field extends views_handler_field {
   function php_post_execute() {
     // Ecexute value PHP code.
     if (!empty($this->options['php_value'])) {
-      $function = create_function('$view, $handler, &$static, $row, $data', $this->options['php_value'] . ';');
+      $function = create_function('$view, $handler, &$static, $row, $data', $this->options['php_value'] . "\n;");
       ob_start();
       foreach ($this->view->result as $i => &$row) {
         $normalized_row = new stdClass;
@@ -144,7 +144,7 @@ class views_php_handler_field extends views_handler_field {
     if (!empty($this->options['use_php_click_sortable']) && !empty($this->php_click_sort_order)) {
       if ($this->options['use_php_click_sortable'] == self::CLICK_SORT_PHP) {
         if (!empty($this->options['php_click_sortable'])) {
-          $this->php_click_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_click_sortable'] . ';');
+          $this->php_click_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_click_sortable'] . "\n;");
         }
       }
       else {
diff --git a/plugins/views/views_php_handler_filter.inc b/plugins/views/views_php_handler_filter.inc
index 79bbee2..9cafaa4 100644
--- a/plugins/views/views_php_handler_filter.inc
+++ b/plugins/views/views_php_handler_filter.inc
@@ -65,7 +65,7 @@ class views_php_handler_filter extends views_handler_filter {
   function php_pre_execute() {
     // Ecexute static PHP code.
     if (!empty($this->options['php_setup'])) {
-      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
+      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . "\n;");
       ob_start();
       $function($this->view, $this, $this->php_static_variable);
       ob_end_clean();
@@ -79,7 +79,7 @@ class views_php_handler_filter extends views_handler_filter {
   function php_post_execute() {
     // Evaluate the PHP code.
     if (!empty($this->options['php_filter'])) {
-      $function = create_function('$view, $handler, &$static, $row, $data', $this->options['php_filter'] . ';');
+      $function = create_function('$view, $handler, &$static, $row, $data', $this->options['php_filter'] . "\n;");
       ob_start();
       foreach ($this->view->result as $i => $row) {
         $normalized_row = new stdClass;
diff --git a/plugins/views/views_php_handler_sort.inc b/plugins/views/views_php_handler_sort.inc
index cca24ba..d4e156d 100644
--- a/plugins/views/views_php_handler_sort.inc
+++ b/plugins/views/views_php_handler_sort.inc
@@ -57,7 +57,7 @@ class views_php_handler_sort extends views_handler_sort {
   function php_pre_execute() {
     // Ecexute static PHP code.
     if (!empty($this->options['php_setup'])) {
-      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
+      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . "\n;");
       ob_start();
       $function($this->view, $this, $this->php_static_variable);
       ob_end_clean();
@@ -70,7 +70,7 @@ class views_php_handler_sort extends views_handler_sort {
    */
   function php_post_execute() {
     if (!empty($this->options['php_sort']) && $this->view->style_plugin->build_sort()) {
-      $this->php_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_sort'] . ';');
+      $this->php_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_sort'] . "\n;");
       ob_start();
       usort($this->view->result, array($this, 'php_sort'));
       ob_end_clean();
diff --git a/plugins/views/views_php_plugin_cache.inc b/plugins/views/views_php_plugin_cache.inc
index ca6c90f..b9bd220 100644
--- a/plugins/views/views_php_plugin_cache.inc
+++ b/plugins/views/views_php_plugin_cache.inc
@@ -63,7 +63,7 @@ class views_php_plugin_cache extends views_plugin_cache {
         $cache = cache_get($this->get_results_key(), $this->table);
         $fresh = !empty($cache);
         if ($fresh && !empty($this->options['php_cache_results'])) {
-          $function = create_function('$view, $plugin, $cache', $this->options['php_cache_results'] . ';');
+          $function = create_function('$view, $plugin, $cache', $this->options['php_cache_results'] . "\n;");
           ob_start();
           $fresh = $function($this->view, $this, $cache);
           ob_end_clean();
@@ -84,7 +84,7 @@ class views_php_plugin_cache extends views_plugin_cache {
         $cache = cache_get($this->get_output_key(), $this->table);
         $fresh = !empty($cache);
         if ($fresh && !empty($this->options['php_cache_output'])) {
-          $function = create_function('$view, $plugin, $cache', $this->options['php_cache_output'] . ';');
+          $function = create_function('$view, $plugin, $cache', $this->options['php_cache_output'] . "\n;");
           ob_start();
           $fresh = $function($this->view, $this, $cache);
           ob_end_clean();
