My class has two methods, as illustrated below:
/**
* Add values to $this->filterArray based upon additional key => val array, key being the display filter type and value being the integer constant required
*
* *NOTE* Unlike getFilterArray() method, this method requires that this class must be instantiated to properly operate. Keep that in mind when you code
*
* @access public
* @param array $newFilterArray
* @see array_combine
* @see array_insert
*/
function &setFilterArray($newFilterArray) { // STATIC VOID METHOD
if (@!ini_get('allow_call_time_pass_reference')) @ini_set('allow_call_time_pass_reference', true);
if (is_array($newFilterArray) && @sizeof($newFilterArray) > 0) foreach ($newFilterArray as $key => $val) @array_insert(&$this->filterArray, array_combine($key, $val));
}
//-------------------------------------------------------------------------------- --* END OF GETTER/SETTER METHODS *-- -------------------------------------------------------------------------------------------------
/**
* Perform filter
*
* @access public
* @return boolean
*/
function &filter() { // STATIC BOOLEAN METHOD
if (@!ini_get('allow_call_time_pass_reference')) @ini_set('allow_call_time_pass_reference', true);
if (is_array($_POST['filter_tech']) && @sizeof($_POST['filter_tech']) > 0) foreach ($_POST['filter_tech'] as $filterInt) if (@!imagefilter(&$this->image, $filterInt)) return false;
return true;
}
--------------------------------------------------------------------------------
Upon evaulation of the class library script I get the following warnings:
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of array_insert(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /include/image_classes.inc.php on line 1071
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of runtime function name. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /include/image_classes.inc.php on line 1083
array_insert() is a function I created whose parameter declaration I can always change (but I don't think I want to, right?), however, imagefilter() is built-in within PHP (using GD 2.0+ of course) and I couldn't possibly "redeclare" that one.
I could always surpress the warnings when including the class library script, but that would only conceal a potential time bomb. What better solution do you recommend I do?
Thanx
Phil