Re: [PHP] Class Problems

2009-08-11 Thread la...@garfieldtech.com
The private keyword was added in PHP 5.  PHP 4 doesn't have visibility 
identifiers.  In PHP 4 you have to use var, which is then always public.


Or you could just use PHP 5 instead of a dead language. :-)

Ashley Sheridan wrote:

Hey all,

Is there any reason why this shouldn't work correctly on a server
running PHP 4.4.7:

?php
class testClass
{
private $foo = 'bar';
}

print 'wtf';
?

I would at the very least expect to see the 'wtf' printed out. I've got
a whole class I've written that works fine in PHP 5, but on PHP 4
server, it does nothing with even this simple example.

Any ideas?

Thanks,
Ash
http://www.ashleysheridan.co.uk




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Class Problems

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 10:40 -0500, la...@garfieldtech.com wrote:
 The private keyword was added in PHP 5.  PHP 4 doesn't have visibility 
 identifiers.  In PHP 4 you have to use var, which is then always public.
 
 Or you could just use PHP 5 instead of a dead language. :-)
 
 Ashley Sheridan wrote:
  Hey all,
  
  Is there any reason why this shouldn't work correctly on a server
  running PHP 4.4.7:
  
  ?php
  class testClass
  {
  private $foo = 'bar';
  }
  
  print 'wtf';
  ?
  
  I would at the very least expect to see the 'wtf' printed out. I've got
  a whole class I've written that works fine in PHP 5, but on PHP 4
  server, it does nothing with even this simple example.
  
  Any ideas?
  
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
  
  
 
Ah, I was looking up in the documentation, but seem to have missed that.
Just changed the code, and it's working again! The public/private thing
will only really be an issue if someone other than me is using this
script, which is unlikely just at the moment, but ah well!

And I really would use a PHP 5 server given the choice. I've tried
speaking to the hosting company a few times, but they brush me off!

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Class Problems

2009-08-11 Thread Aschwin Wesselius

Ashley Sheridan wrote:

And I really would use a PHP 5 server given the choice. I've tried
speaking to the hosting company a few times, but they brush me off!
  

Hi Ashley,

And how is their SLA then? Do you take full responsibility in case of a 
security breach? PHP 4 is way long ago and there are plenty hosting 
companies that do have PHP 5 and have a clear security/update policy.


You, yes YOU, are their client paying their sandwich. If you are not 
serviced properly, they have to eat one less. Now, go on and brush them 
off..


Kind regards,

Aschwin Wesselius

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Class Problems

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 17:57 +0200, Aschwin Wesselius wrote:
 Ashley Sheridan wrote:
  And I really would use a PHP 5 server given the choice. I've tried
  speaking to the hosting company a few times, but they brush me off!

 Hi Ashley,
 
 And how is their SLA then? Do you take full responsibility in case of a 
 security breach? PHP 4 is way long ago and there are plenty hosting 
 companies that do have PHP 5 and have a clear security/update policy.
 
 You, yes YOU, are their client paying their sandwich. If you are not 
 serviced properly, they have to eat one less. Now, go on and brush them 
 off..
 
 Kind regards,
 
 Aschwin Wesselius
 
My last email to them said that if they don't do something soon, then
I'm going elsewhere, so I'll see if that spurs them on. I'm not into
naming and shaming, but if they don't get back to me on this at all,
then I feel a blog rant coming on!

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Class Problems

2009-08-11 Thread la...@garfieldtech.com

Ashley Sheridan wrote:

On Tue, 2009-08-11 at 17:57 +0200, Aschwin Wesselius wrote:

Ashley Sheridan wrote:

And I really would use a PHP 5 server given the choice. I've tried
speaking to the hosting company a few times, but they brush me off!
  

Hi Ashley,

And how is their SLA then? Do you take full responsibility in case of a 
security breach? PHP 4 is way long ago and there are plenty hosting 
companies that do have PHP 5 and have a clear security/update policy.


You, yes YOU, are their client paying their sandwich. If you are not 
serviced properly, they have to eat one less. Now, go on and brush them 
off..


Kind regards,

Aschwin Wesselius


My last email to them said that if they don't do something soon, then
I'm going elsewhere, so I'll see if that spurs them on. I'm not into
naming and shaming, but if they don't get back to me on this at all,
then I feel a blog rant coming on!

Thanks,
Ash
http://www.ashleysheridan.co.uk


http://gophp5.org/hosts

Over 200 web hosts that have been committed to PHP 5.2 for at least 1.5 
years, in most cases over two years.  I am not affiliated with any of 
them directly.


--Larry Garfield

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] class problems

2001-10-18 Thread Valentin V. Petruchek

Try to create an instant of the class like this:
?php
class test
{
var $table = val;

function showName()
{
return $this-table;
}

}
$test = new Test;
echo $test-showName();

?
- Original Message -
From: Matt Williams [EMAIL PROTECTED]
To: PHP General List [EMAIL PROTECTED]; PHP_UK@egroups.
[EMAIL PROTECTED]
Sent: Thursday, October 18, 2001 4:25 PM
Subject: [PHP] class problems


 Any ideas why this won't output anything

 ?php
 class test
 {
 var $table = matt;

 function showName()
 {
 return $this-table;
 }

 }

 echo test::showName();

 ?

 I have other classes along the similar lines but a lot bigger which work
 fine.
 I'm also using phplib which has a lot of this stuff going on...

 I remeber seeing something regarding it in the manual but i don't get how
 it's all worked before.

 I'm using php4.06 apache 1.3.19 on win2k.

 TIA

 M:


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] class problems

2001-10-18 Thread Matt Williams

Ok got it from here.

http://uk.php.net/manual/en/keyword.paamayim-nekudotayim.php

using :: allows use of a class function but doesn't allow access the object,
so to access $this I do need to instantiate the class

Thanks

M:

 Try to create an instant of the class like this:
 ?php
 class test
 {
 var $table = val;

 function showName()
 {
 return $this-table;
 }

 }
 $test = new Test;
 echo $test-showName();

 ?


M:

 -Original Message-
 From: Valentin V. Petruchek [mailto:[EMAIL PROTECTED]]
 Sent: 18 October 2001 14:39
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] class problems


 Try to create an instant of the class like this:
 ?php
 class test
 {
 var $table = val;

 function showName()
 {
 return $this-table;
 }

 }
 $test = new Test;
 echo $test-showName();

 ?
 - Original Message -
 From: Matt Williams [EMAIL PROTECTED]
 To: PHP General List [EMAIL PROTECTED]; PHP_UK@egroups.
 [EMAIL PROTECTED]
 Sent: Thursday, October 18, 2001 4:25 PM
 Subject: [PHP] class problems


  Any ideas why this won't output anything
 
  ?php
  class test
  {
  var $table = matt;
 
  function showName()
  {
  return $this-table;
  }
 
  }
 
  echo test::showName();
 
  ?
 
  I have other classes along the similar lines but a lot bigger which work
  fine.
  I'm also using phplib which has a lot of this stuff going on...
 
  I remeber seeing something regarding it in the manual but i
 don't get how
  it's all worked before.
 
  I'm using php4.06 apache 1.3.19 on win2k.
 
  TIA
 
  M:
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] class problems

2001-10-18 Thread Valentin V. Petruchek

Sorry and thanks - have not use it before/
But i've tried this:

?php
class test
{

function showName()
{
$this-qtable = 'val';
return $this-qtable;
}

}

echo test::showName();

?

worked :)




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]