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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:07:27+00:00 2026-06-05T00:07:27+00:00

The question is about functions and arguments in PHP. I am reading code of

  • 0

The question is about functions and arguments in PHP. I am reading code of simple extension for mediawiki.
It adds callback function:

$wgHooks['ArticleSaveComplete'][] = 'fnAutoWikiDump';

and then there is definition of this function:

function fnAutoWikiDump(&$article, &$user, &$text, &$summary, &$minoredit, 
                    &$watchthis, &$sectionanchor, &$flags, &$revision){...}

inside this function I can access members of class $article:

$awd_title = $article->getTitle();

I cannot understand how variable $article was passed to the function while calling it? It looks like it was passed in definition of the function (I know it is wrong), but I don’t understand how it was passed.
Do you?

  • 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-05T00:07:28+00:00Added an answer on June 5, 2026 at 12:07 am

    The code you have posted, and the sample code in the link do not show the details of actually calling the function. It is merely registered as a callback. Part of the usefulness of callback functions is that you typically do not have to call them yourself at all, but rather they are called automatically by the process that uses them.

    Somewhere else in the MediaWiki code, where the callbacks registered with ArticleSaveComplete are called (there’s an array of them), the correct parameters are passed to the function call in a regular and recognizable function call or via a mechanism like call_user_func().

    When defining a callback to work with that interface, your responsibility as a programmer is only to be sure that the function definition takes the correct number of parameters in the correct order, and with the correct names. The details of how it gets called are up to the mechanism that calls it.

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

Sidebar

Related Questions

In answering a question about a function that maps over multiple functions with the
I have a quick question about this PHP function here. What is the am
I have a simple question about the barplot function. I have a TRUE/FALSE table
Just started learning x64 assembly and I have a question about functions, arguments, and
This question is about functions that take arrays of statically known size. Take for
I just have a question about writing functions in jQuery. When defining your own
My question is about angle functions in programming languge Java. if i want to
This is a general question about Object Orientation and specifically overloading functions in .NET
I am learning Node.js recently. I have a question about the function util.inherits in
I am using native C++ with VSTS 2008. A quick question about virtual function.

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.