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

  • Home
  • SEARCH
  • 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 8638713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:48:26+00:00 2026-06-12T10:48:26+00:00

I am misunderstanding how php object references are meant to work. I understand that

  • 0

I am misunderstanding how php object references are meant to work. I understand that in php 5 reference assignment is automatic for objects. I understand how reference assignment works for non objects.

I want to pass a reference to an object instance from a method to the calling code and then call a method of that class using the instance reference.

When I attempt this I get :

Fatal error: Call to a member function update_Sessions_For_Schedule()
on a non-object in…

I have read through a number of similar SO postings but I am no closer finding why I am unable to do this.

So what I have is:

class Schedule checks with class Time_Tabler that a new schedule can be added to the time table prior to allowing it’s creation. So obviously during this process Time_Tabler is instantiated.

I want to access this instance from the php code which instantiated the schedule and then call method update_Sessions_For_Schedule() using that instance.

So I have method get_Checked_Time_Table() in class Schedule :-

I have tried this in two formats:

With explicit reference assignment:

public function &get_Checked_Time_Table(){
    global $test_Time_Tabler;
    return $test_Time_Tabler;
}

where $test_Time_Tabler is instantiated in an earlier class Schedule method.

which is called by

    $tested_Time_Table =& $complete_Schedule->get_Checked_Time_Table();

Without explicit reference assignment:

public function get_Checked_Time_Table(){
    global $test_Time_Tabler;
    return $test_Time_Tabler;
}

where $test_Time_Tabler is instantiated in an earlier class Schedule method.

which is called by

$tested_Time_Table = $complete_Schedule->get_Checked_Time_Table();

In either case

$tested_Time_Table->update_Sessions_For_Schedule($update_As_Insert);

produces the Fatal error.

I do not understand why the reference is not recognised as being an object of class Time_Tabler thus making it possible to call the method.

Any thoughts welcomed.

  • 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-12T10:48:27+00:00Added an answer on June 12, 2026 at 10:48 am

    I have resolved this problem.

    The resolution to the problem was, as always stupidly simple. The instance was not persisting so by the time I wanted to refer back to it it didn’t exist.

    So to ensure that the instance still exists at the point of refer back I made a clone of it.

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

Sidebar

Related Questions

Perhaps I'm misunderstanding how this should work, but I've created an object in the
I think that I am misunderstanding something about how jquery $(this) works. In my
I have a PHP-based web app that I'm trying to apply Apache's mod_rewrite to.
Am I misunderstanding how git grep --cached foo works? Running git version 1.6.4.4 or
I may be greatly misunderstanding this threading scenario, but that's why I'm asking. What
I'm trying to create a very simple PHP CLI application that can be run
Just tried out the following approach finding that this does not work? (Using jQuery):
My site is HTML/Javascript with AJAX calling server-side PHP. I want to allow the
I'm probably misunderstanding JSON, but why this code doesn't work? HTML <html> <head> <title>Test</title>
I have the following code from Codeigniter index.php My understanding is that, If /

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.