Sorry for the top posting... I didn't mean to send that message
anyway... it had pretty much been answered already. Fat fingers!
-Rob
___
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentation
Anywhere you call something statically -- i.e. with :: -- you can't
use $this
On Jul 27, 2007, at 10:51 AM, Ben Sgro ((ProjectSkyLine)) wrote:
Hello Andy,
I tried your 1st, quicker method, I get:
PHP Fatal error: Access to undeclared static property: Error::
$builtMessage in /var/www/htm
Ben, I neglected to add this to my response. You need something like
private static $builtMessage; in your Error class.
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Friday, July 27, 2007 10:54 AM
To: NYPHP Talk
Subject: Re: [nyphp-talk] OOP
Thanks to all,
I ended up just passing the object to the function.
- Ben
Ben Sgro, Chief Engineer
ProjectSkyLine - Defining New Horizons
- Original Message -
From: [EMAIL PROTECTED]
To: NYPHP Talk
Sent: Friday, July 27, 2007 10:54 AM
Subject: Re: [nyphp-talk] OOP Error/Questi
variables can be defined as static also...- Original Message -From:
"Ben Sgro (ProjectSkyLine)" Date: Friday, July 27, 2007 10:52 amSubject: Re:
[nyphp-talk] OOP Error/QuestionTo: NYPHP Talk > Hello Andy, > > I tried your
1st, quicker method, I get:> > PHP Fatal error: Access to undecla
Hello Andy,
I tried your 1st, quicker method, I get:
PHP Fatal error: Access to undeclared static property: Error::$builtMessage
in /var/www/html/sk/OOPLIB/ERRO.php on line 81
self::$builtMessage = $errorStr;
builtMessage is declared as:
$this->builtMessage = '';
in the class
Try self::$builtMessage = $errorStr;
Or another option is to adopt the singleton pattern. This will give you the
same instance of the Error object anywhere you try to use it in your code.
Something like:
class Error {
private function __constrct () {
}
public function GetIn
Hello,
Thanks, both your fixes fixed this issue.
However, it broke it in another place.
PHP Fatal error: Using $this when not in object context in
/var/www/html/sk/OOPLIB/ERRO.php on line 80
Inside the Backtrace( ) function I have:
$this->builtMessage = $errorStr;
To save the messag
you're calling Error statically, so there can't be any object instance
references... instead of $this->Backtrace(), use self::Backtrace();-
Original Message -From: "Ben Sgro (ProjectSkyLine)" Date: Friday, July 27,
2007 10:10 amSubject: [nyphp-talk] OOP Error/QuestionTo: NYPHP Talk > Goo
Try self::Backtrace ();, making sure that Backtrace is marked as static.
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ben Sgro (ProjectSkyLine)
Sent: Friday, July 27, 2007 10:11 AM
To: NYPHP Talk
Subject: [nyphp-talk] OOP Error/Question
Good morning,
So, I
Good morning,
So, I have a script where I'm calling:
function ReceivePOPEmail($popObject)
{
$error = $popObject->Login($popObject->username,$popObject->password,
$popObject->apop);
if ( $error != '' )
{
/* We've had a
11 matches
Mail list logo