diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index 6d21c98..45bb706 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -376,8 +376,8 @@ function ajax_form_callback() {
   if (!empty($form_state['triggering_element'])) {
     $callback = $form_state['triggering_element']['#ajax']['callback'];
   }
-  if (!empty($callback) && function_exists($callback)) {
-    return $callback($form, $form_state);
+  if (!empty($callback) && is_callable($callback)) {
+    return call_user_func_array($callback, array(&$form, &$form_state));
   }
 }
 
diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
index 260d911..33d411f 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
+++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
@@ -5,6 +5,8 @@
  * Simpletest mock module for Ajax forms testing.
  */
 
+use Drupal\ajax_forms_test\Callbacks;
+
 /**
  * Implements hook_menu().
  */
@@ -37,11 +39,12 @@ function ajax_forms_test_menu() {
   return $items;
 }
 
-
 /**
  * A basic form used to test form_state['values'] during callback.
  */
 function ajax_forms_test_simple_form($form, &$form_state) {
+  $object = new Callbacks();
+
   $form = array();
   $form['select'] = array(
     '#type' => 'select',
@@ -50,7 +53,7 @@ function ajax_forms_test_simple_form($form, &$form_state) {
       'green' => 'green',
       'blue' => 'blue'),
     '#ajax' => array(
-      'callback' => 'ajax_forms_test_simple_form_select_callback',
+      'callback' => array($object, 'selectCallback'),
     ),
     '#suffix' => '<div id="ajax_selected_color">No color yet selected</div>',
   );
@@ -59,7 +62,7 @@ function ajax_forms_test_simple_form($form, &$form_state) {
     '#type' => 'checkbox',
     '#title' => t('Test checkbox'),
     '#ajax' => array(
-       'callback' => 'ajax_forms_test_simple_form_checkbox_callback',
+       'callback' => array($object, 'checkboxCallback'),
     ),
     '#suffix' => '<div id="ajax_checkbox_value">No action yet</div>',
   );
@@ -71,27 +74,6 @@ function ajax_forms_test_simple_form($form, &$form_state) {
 }
 
 /**
- * Ajax callback triggered by select.
- */
-function ajax_forms_test_simple_form_select_callback($form, $form_state) {
-  $commands = array();
-  $commands[] = ajax_command_html('#ajax_selected_color', $form_state['values']['select']);
-  $commands[] = ajax_command_data('#ajax_selected_color', 'form_state_value_select', $form_state['values']['select']);
-  return array('#type' => 'ajax', '#commands' => $commands);
-}
-
-/**
- * Ajax callback triggered by checkbox.
- */
-function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) {
-  $commands = array();
-  $commands[] = ajax_command_html('#ajax_checkbox_value', (int) $form_state['values']['checkbox']);
-  $commands[] = ajax_command_data('#ajax_checkbox_value', 'form_state_value_select', (int) $form_state['values']['checkbox']);
-  return array('#type' => 'ajax', '#commands' => $commands);
-}
-
-
-/**
  * Form to display the Ajax Commands.
  */
 function ajax_forms_test_ajax_commands_form($form, &$form_state) {
diff --git a/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Callbacks.php b/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Callbacks.php
new file mode 100644
index 0000000..6b8dfb7
--- /dev/null
+++ b/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Callbacks.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\ajax_forms_test\Callbacks.
+ */
+
+namespace Drupal\ajax_forms_test;
+
+/**
+ * Simple object for testing methods as Ajax callbacks.
+ */
+class Callbacks {
+
+  /**
+   * Ajax callback triggered by select.
+   */
+  function selectCallback($form, $form_state) {
+    $commands = array();
+    $commands[] = ajax_command_html('#ajax_selected_color', $form_state['values']['select']);
+    $commands[] = ajax_command_data('#ajax_selected_color', 'form_state_value_select', $form_state['values']['select']);
+    return array('#type' => 'ajax', '#commands' => $commands);
+  }
+
+  /**
+   * Ajax callback triggered by checkbox.
+   */
+  function checkboxCallback($form, $form_state) {
+    $commands = array();
+    $commands[] = ajax_command_html('#ajax_checkbox_value', (int) $form_state['values']['checkbox']);
+    $commands[] = ajax_command_data('#ajax_checkbox_value', 'form_state_value_select', (int) $form_state['values']['checkbox']);
+    return array('#type' => 'ajax', '#commands' => $commands);
+  }
+}
\ No newline at end of file
