diff --git a/includes/plugins.inc b/includes/plugins.inc
index 9077d38..f41d841 100644
--- a/includes/plugins.inc
+++ b/includes/plugins.inc
@@ -175,12 +175,12 @@ class panels_cache_object {
 
     // If there are any differences between the old and the new javascript then
     // store them to be added later.
-    if ($diff = array_diff_assoc($js, $start)) {
+    if ($diff = drupal_array_diff_assoc_recursive($js, $start)) {
       $this->js = $diff;
     }
 
     // Special case the settings key and get the difference of the data.
-    if ($settings_diff = array_diff_assoc($js['settings']['data'], $start['settings']['data'])) {
+    if ($settings_diff = drupal_array_diff_assoc_recursive($js['settings']['data'], $start['settings']['data'])) {
       $this->js['settings'] = $settings_diff;
     }
 
@@ -483,3 +483,38 @@ function panels_plugin_get_function($plugin, $which, $function_name) {
     return ctools_plugin_load_function('panels', $plugin, $which, $function_name);
   }
 }
+
+
+if (!function_exists('drupal_array_diff_assoc_recursive')) {
+  /**
+   * Drop-in replacement for a function added in Drupal 7.23.
+   *
+   * This is an exact copy of the function added in Drupal 7.23 to avoid issues
+   * with array_diff_assoc and php 5.4.
+   *
+   * @link https://drupal.org/node/1850798 Related Drupal issue
+   * @link https://drupal.org/node/1762290 Related Panels issue
+   */
+  function drupal_array_diff_assoc_recursive($array1, $array2) {
+    $difference = array();
+
+    foreach ($array1 as $key => $value) {
+      if (is_array($value)) {
+        if (!array_key_exists($key, $array2) || !is_array($array2[$key])) {
+          $difference[$key] = $value;
+        }
+        else {
+          $new_diff = drupal_array_diff_assoc_recursive($value, $array2[$key]);
+          if (!empty($new_diff)) {
+            $difference[$key] = $new_diff;
+          }
+        }
+      }
+      elseif (!array_key_exists($key, $array2) || $array2[$key] !== $value) {
+        $difference[$key] = $value;
+      }
+    }
+
+    return $difference;
+  }
+}
