Title: parameter expected to be reference
Last modified: June 9, 2018

---

# parameter expected to be reference

 *  [conchell](https://wordpress.org/support/users/conchell/)
 * (@conchell)
 * [8 years ago](https://wordpress.org/support/topic/parameter-expected-to-be-reference/)
 * Parameter 2 to Cf73rdParty_SubsAjaxCallbacks::ajax_postprocess() expected to 
   be a reference, value given in …
 * Using sample codes found in Github
 *     ```
       if(!class_exists('Cf73rdParty_SubsAjaxCallbacks')):
       /**
        * Encapsulate any and all 3rd-party service callback functions
        */
           class Cf73rdParty_SubsAjaxCallbacks {
           	public function __construct(){
           		/** newsletter - mailchimp - subscribe **/
   
           		//actions require 2 parameters: 3rd-party response, results placeholders
           		///NOTE: customize this hook name to match your Service (in the admin settings)
                   add_action('Forms3rdPartyIntegration_service_a0', array(&$this, 'ajax_postprocess'), 10, 2);
                   add_action('Forms3rdPartyIntegration_service_a1', array(&$this, 'ajax_postprocess'), 10, 2);
   
           	}//--	function __construct
           	/**
           	 * Callback hook for 3rd-party service Mailchimp - Newsletter signup form
           	 * @param $response the remote-request response (in this case, it's a serialized string)
           	 * @param &$results the callback return results (passed by reference since function can't return a value; also must be "constructed by reference"; see plugin)
           	 */
   
                public function ajax_postprocess($response, &$results) {
                    try {
                		// do something with $response
   
                		// set return results - text to attach to the end of the email
                		$results['attach'] = $response;
   
                		///add_filter('wpcf7_mail_components', (&$this, 'filter_'.__FUNCTION__));
                	} catch(Exception $ex){                
                		// indicate failure by adding errors as an array
                		$results['errors'] = array($ex->getMessage());
                	}
                }
   
           	// public function mailchimp_newsletter_action($response, &$results){
           	// 	try{
           	// 		// look once more for success message, in case someone didn't set up the success clause
           	// 		if( false !== strpos($response, 'please click the link in the email we just sent you') ) :
           	// 			$results['message'] = 'To complete the subscription process, please click the link in the email we just sent you.';
           	// 		else:
           	// 			$results['errors'] = array('Failed to submit response to Newsletter Signup at MailChimp');
           	// 		endif;
               //
           	// 		///add_filter('wpcf7_mail_components', (&$this, 'filter_'.__FUNCTION__));
           	// 	} catch(Exception $ex){
           	// 		$results['errors'] = array($ex->getMessage());
           	// 	}
               //
           	// 	#wp_mail( 'debug_address@email.com', 'Callback Hit', 'callback:'.__FUNCTION__."\n\ndata:\n".print_r($response,true)."\n\nresults:\n".print_r($results, true) );
           	// }//--	function mailchimp_newsletter_action
   
           }//---	class Cf73rdParty_MailchimpCallbacks
           //start 'em up
           $cf73rdpartycallback_instance = new Cf73rdParty_SubsAjaxCallbacks();
       endif;	//class-exists
       ```
   
 * From what I could find, it seems to be some problem in conflict with php 7 above?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/parameter-expected-to-be-reference/#post-10394827)
 * Yes, I have completely neglected to update the random examples…just remove the`&`
   from the variable name and you should be fine.
 *  Thread Starter [conchell](https://wordpress.org/support/users/conchell/)
 * (@conchell)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/parameter-expected-to-be-reference/#post-10409719)
 * Yup, that fix it. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘parameter expected to be reference’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/forms-3rdparty-integration.svg)
 * [Forms: 3rd-Party Integration](https://wordpress.org/plugins/forms-3rdparty-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forms-3rdparty-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forms-3rdparty-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forms-3rdparty-integration/reviews/)

## Tags

 * [example](https://wordpress.org/support/topic-tag/example/)

 * 2 replies
 * 2 participants
 * Last reply from: [conchell](https://wordpress.org/support/users/conchell/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/parameter-expected-to-be-reference/#post-10409719)
 * Status: not resolved