Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:58:16+00:00 2026-06-17T07:58:16+00:00

I am passing the two var’s by ref to change them, and once I

  • 0

I am passing the two var’s by ref to change them, and once I have changed them or one of the (8 loops) have found a positive in the string I am using, I want to exit the function, but I don’t need to return anything because they are passed by ref.

I could just pass a copy of one and then ref the other one and set the var of the one that is copied = to the function and return that, but is there a cleaner way where I just call the function, the vars are set and I can move on?

function get_cat_size($urlstr, &$cat, &$size){ return null; };

$cat = get_cat_size($urlstr, &$size);

Does the first one work or not? Witch is better for readability?

Thanks for the input!

while( $i < $countz )
    {
    $pos = strpos($outdoor, $outdoor[$i]);
    if($pos != false)
    {
        $cat = $outdoorID;
            while( $j < $sizeArrayCount)
            {
            $poz = strpos($outdoor, $outdoor[$i]);
            if($poz != false)
            {
                $size = $outdoorID;
                return;
            }
            $j++;
            }
        return;
    }
    $i++;
    }

^ so this should work yes no maybe so?

So this is one of 8 loops set up in a order because they are least important to important, with different var = different stores.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:58:17+00:00Added an answer on June 17, 2026 at 7:58 am

    You can just return without a value:

    function returnsNothing (&$a, &$b) {
        return;
    }
    

    Or simpler just omit the return statement at all

    function returnsNothing (&$a, &$b) {
        // do something
    }
    

    Both snippets will make the function returning NULL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got two functions, passing one of then as parameter, like: var a =
I've been having problems passing parameters from one .jsp to another. I have two
I have this code below. As you can see I am passing two variables
I'm trying to glue together two web services by passing a value from one
I have an IF statement that consists of two separate function calls passing values
I have two IEnumerable collections that I would like to union. One selects news
The situation is I have two xslt files: one is called from my ASP.NET
I have the below jquery function $(function(){ $(select#rooms).change(function(){ $.getJSON(/admin/select.php,{id: $(this).val(), ajax: 'true'}, function(j){ var
I have the following two functions: $(.content).click( function() { var id = this.id; $.get(InfoRetrieve,
After reading this question here: Passing one Dimension of a Two Dimensional Array in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.