Re: Class Problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux