diff --git a/plugins/views/views_php_handler_area.inc b/plugins/views/views_php_handler_area.inc
index 0296373..ed14bcf 100644
--- a/plugins/views/views_php_handler_area.inc
+++ b/plugins/views/views_php_handler_area.inc
@@ -34,9 +34,9 @@ class views_php_handler_area extends views_handler_area {
    * Implements views_handler_area#render().
    */
   function render($empty = FALSE) {
-    // Ecexute output PHP code.
+    // Execute output PHP code.
     if ((!$empty || !empty($this->options['empty'])) && !empty($this->options['php_output'])) {
-      $function = create_function('$view, $handler, $results', ' ?>' . $this->options['php_output'] . '<?php ');
+      $function = views_php_create_function('$view, $handler, $results', ' ?>' . $this->options['php_output'] . '<?php ');
       ob_start();
       $function($this->view, $this, $this->view->result);
       return ob_get_clean();
diff --git a/plugins/views/views_php_handler_field.inc b/plugins/views/views_php_handler_field.inc
index a455a49..07dced2 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() {
     // Execute static PHP code.
     if (!empty($this->options['php_setup'])) {
-      $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
+      $function = views_php_create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
       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() {
     // Execute value PHP code.
     if (!empty($this->options['php_value'])) {
-      $function = create_function('$view, $handler, &$static, $row', $this->options['php_value'] . ';');
+      $function = views_php_create_function('$view, $handler, &$static, $row', $this->options['php_value'] . ';');
       ob_start();
       foreach ($this->view->result as $i => &$row) {
         $normalized_row = new stdClass;
@@ -149,7 +149,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 = views_php_create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_click_sortable'] . ';');
         }
       }
       else {
@@ -165,6 +165,7 @@ class views_php_handler_field extends views_handler_field {
 
       if (isset($this->php_click_sort_function)) {
         usort($this->view->result, array($this, 'php_click_sort'));
+        unset($this->php_click_sort_function); /* Closures are not serializable. */
       }
     }
   }
@@ -204,8 +205,6 @@ class views_php_handler_field extends views_handler_field {
    */
   function render($values) {
     if (!empty($this->options['php_output'])) {
-      $this->php_output_lamda_function = create_function('$view, $handler, &$static, $row, $data, $value', ' ?>' . $this->options['php_output'] . '<?php ');
-
       $normalized_row = new stdClass;
       if (empty($this->view->style_plugin->rendered_fields)) {
         foreach ($this->view->field as $id => $field) {
@@ -219,7 +218,7 @@ class views_php_handler_field extends views_handler_field {
         }
       }
 
-      $function = $this->php_output_lamda_function;
+      $function = views_php_create_function('$view, $handler, &$static, $row, $data, $value', ' ?>' . $this->options['php_output'] . '<?php ');
       ob_start();
       $function($this->view, $this, $this->php_static_variable, $normalized_row, $values, isset($values->{$this->field_alias}) ? $values->{$this->field_alias} : NULL);
       $value = ob_get_clean();
diff --git a/plugins/views/views_php_handler_filter.inc b/plugins/views/views_php_handler_filter.inc
index 0c97a92..034166b 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 = views_php_create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
       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_pre_render() {
     // Evaluate the PHP code.
     if (!empty($this->options['php_filter'])) {
-      $function = create_function('$view, $handler, &$static, $row, $data', $this->options['php_filter'] . ';');
+      $function = views_php_create_function('$view, $handler, &$static, $row, $data', $this->options['php_filter'] . ';');
       ob_start();
 
       $normalized_row = new stdClass;
diff --git a/plugins/views/views_php_handler_sort.inc b/plugins/views/views_php_handler_sort.inc
index cca24ba..3300c1e 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 = views_php_create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
       ob_start();
       $function($this->view, $this, $this->php_static_variable);
       ob_end_clean();
@@ -70,9 +70,10 @@ 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 = views_php_create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_sort'] . ';');
       ob_start();
       usort($this->view->result, array($this, 'php_sort'));
+      unset($this->php_sort_function); /* Closure objects are not serializable. */
       ob_end_clean();
     }
   }
diff --git a/plugins/views/views_php_plugin_cache.inc b/plugins/views/views_php_plugin_cache.inc
index ca6c90f..cd82681 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 = views_php_create_function('$view, $plugin, $cache', $this->options['php_cache_results'] . ';');
           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 = views_php_create_function('$view, $plugin, $cache', $this->options['php_cache_output'] . ';');
           ob_start();
           $fresh = $function($this->view, $this, $cache);
           ob_end_clean();
diff --git a/views_php.module b/views_php.module
index 53bd526..9244885 100644
--- a/views_php.module
+++ b/views_php.module
@@ -27,7 +27,7 @@ function views_php_check_access($php_access, $view_name, $display_id, $account =
   }
 
   if (!isset($function[$view_name . ':' . $display_id])) {
-    $function[$view_name . ':' . $display_id] = create_function('$view_name, $display_id, $account', $php_access . ';');
+    $function[$view_name . ':' . $display_id] = views_php_create_function('$view_name, $display_id, $account', $php_access . ';');
   }
 
   ob_start();
@@ -167,3 +167,10 @@ function views_php_views_post_build($view) {
     $view->build_info['query']->range();
   }
 }
+
+/**
+ * Internal support: create_function() emulation using anonymous functions.
+ */
+function views_php_create_function($args, $code) {
+  return eval('return function (' . $args . ') {' . $code . '};');
+}
