Class Problems
am 11.08.2009 17:35:35 von Ashley Sheridan
Hey all,
Is there any reason why this shouldn't work correctly on a server
running PHP 4.4.7:
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: Class Problems
am 11.08.2009 17:40:07 von Larry Garfield
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:
>
>
> 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: Class Problems
am 11.08.2009 17:42:03 von Ollisso
On Tue, 11 Aug 2009 18:35:35 +0300, Ashley Sheridan
wrote:
> Hey all,
>
> Is there any reason why this shouldn't work correctly on a server
> running PHP 4.4.7:
>
>
> 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?
>
PHP4 does not support classes that much.
Especially private/public keywords.
PS: you should enable display_errors and set error_reporting(E_ALL), then
you will see error here.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Class Problems
am 11.08.2009 17:46:39 von Ashley Sheridan
On Tue, 2009-08-11 at 10:40 -0500, larry@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:
> >
> >
> > 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: Class Problems
am 11.08.2009 17:57:56 von 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: Class Problems
am 11.08.2009 17:59:56 von 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: Class Problems
am 11.08.2009 19:02:01 von Larry Garfield
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