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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:03:36+00:00 2026-05-27T14:03:36+00:00

The code: <?php class My_Test{ public $exists = ‘yah’; public function test(){ return $this->exists;

  • 0

The code:

<?php

class My_Test{

    public $exists = 'yah';

    public function test(){
            return $this->exists;
    }

}

$test = new My_Test;
echo $test->test();

produces the following error intermittently (every other page request on average) on two servers:

( ! ) Notice: Trying to get property of non-object in test.php on line 8
Call Stack
#   Time    Memory  Function    Location
1   0.0003  636392  {main}( )   ../test.php:0
2   0.0003  636840  My_Test->test( )    ../test.php:14

where line 10 is `return $this->exists;

Please note this is not an untested example, it is the full code that produces the error. I’m aware the code is valid but it doesn’t work in two environments.

I’m really not sure why! One server is running PHP 5.3.3 (fedora), the other PHP 5.3.2 (ubuntu). I’ve tried rebooting the servers too. They don’t share anything, although they are on the same network.

Anyone got any tips for debugging?

  • 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-05-27T14:03:37+00:00Added an answer on May 27, 2026 at 2:03 pm

    As people before stated the code looks fine and should not cause any errors.

    Therefore I guess it is related to an error of the php engine itself:

    How did you install PHP?

    • Did you compile the sourcecode yourself? Have ./configure or make logged any warnings or error messages while executing?
    • Have you installed PHP by use of a package manager? (I guess everything should be fine then).

    How did you configure PHP?

    • Have you made any changes to php.ini like changing memory limit, paths, etc. ?
    • Have you installed any extension that might cause issues? My experience says often opcode caches (e.g. APC) can cause errors that cannot be easily explained. Also debuggers or other extensions may cause interferences.

    Do you have any (additional) error messages in your HTTP-Daemon-Log?

    • Sometimes additional errors can be found in the error.log file in case the server is configured to do so (e.g. unexpected termination of script or similar).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code: <?php class Test_Class { public function Show() { return Test_Class->Show() function;
Here's my Zend code: <?php require_once ('Zend\Form.php'); class Sergio_Form_registrationform extends Zend_Form { public function
In this code: <?php class Foo { var $value; function foo($value) { $this->setValue($value); }
Consider this class: class Test { public $obj; function __construct ($obj) { $this->obj =
Lets say I have this code: <?php class hello { var $greeting = hello;
I'm learning by reading this tutorial: Link Here's the code: <?php require_once 'Zend/Loader.php'; class
Here's what I'd like: Here's my code: <?php require_once ('Zend\Form.php'); class Sergio_Form_registrationform extends Zend_Form
Here's the code: <?php class Order extends Zend_Db_Table_Abstract { protected $_name = 'orders'; protected
Here's the code: <?php class Order extends Zend_Db_Table_Abstract { protected $_name = 'orders'; protected
I just saw this code while studying the wordpress source code (PHP), You can

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.