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 9240203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:08:57+00:00 2026-06-18T08:08:57+00:00

I have a body function and a function called within the first one. As

  • 0

I have a body function and a function called within the first one.

As can be seen below I don’t change the parameters name while using in the second function.

Is it necessary to change the params names for use inside _display_bar();? What are the side effects if I don’t?

    function main_func($form, &$form_state, $key, $code) {
    $output = '';
    ...
    $output .= _display_navbar($trans, $status_names);

    return $output
    }

    function _display_navbar($trans, $status_names) {
     $trans = 'bla';
     $status_names = 'another bla';
   $bar = $trans . ':' .$status_names;
     return $bar;
    };
  • 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-18T08:08:58+00:00Added an answer on June 18, 2026 at 8:08 am

    It actually does not matter. But you better should not have the same names – it is confusing. Let me give you an example. $s will have 3 after the first function call to sum; 7 after the second function call to sum. The parameters did not have the same name as the function parameter names.

    To answer your question fully – there are absolutely no side effects.

    function main()
    {
        $a = 1;
        $b = 2;
        $s = sum($a, $b);
    
        $d = 3;
        $e = 4;
        $s = sum($d, $e);
    }
    
    function sum($first, $second) 
    {
        $ret = $first + $second;
        return $ret;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a function called name() , I can check if (name()) {}
I have a java script function that i have called on body load mousemove()
I would like to have a function called in an onclick handler, within an
I have have a function that gets called by onbeforeunload. Within I wish to
as you see in the code below. I have a jQuery function called externally.
I have the following jquery code: $(document).ready(function() { $(body[class*=page-calendar-practices] #content-header h1#title).after(<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com'
I have function like this: function gi_insert() { if(!IS_AJAX){ $this->load->library('form_validation'); $this->form_validation->set_rules('name', 'Naslov', 'trim|required|strip_tags'); $this->form_validation->set_rules('body',
i have this code: $('.access a').toggle(function() { $('link').attr('href', 'styles/accessstyles.css'); $('body').css('font-size', '16px'); }, function() {
Let's say I have this $(document).ready(function() { var array = $.makeArray($('p')); $(array).appendTo(document.body); }); });
I mean I have this code: <script> $(document).ready( function() { $('html, body').animate({ scrollTop: $(.error).offset().top

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.