Code: Select all
Fatal error: Cannot pass parameter 1 by reference in /Users/d11wtq/public_html/swiftmailer2/branches/php4/v3_2/tests/units/testcases/TestOfMime.php on line 27In PHP5, I don't need to think about the use of the reference operator very much for method declarations because they sorted out the OO model a heck of a lot, so I simply did something like this:
Code: Select all
public functon foo($input)
{
if ($input instanceof Something) { /* do one thing*/ }
else { /* cast as (string) and do something else */ }
}Now that I'm converting the code to PHP4 I have to declare the method like this:
Code: Select all
public functon foo(&$input)
{
if (is_a($input, "Something")) { /* do one thing*/ }
else { /* cast as (string) and do something else */ }
}