Re: [PHP] Re: Static functions (java/php)

2003-02-10 Thread David Eisenhart
use the error_reporting function:
http://www.php.net/manual/en/function.error-reporting.php



"Joshua Moore-Oliva" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How would I go about setting the error reporting level?
>
> Josh.
>
> On February 9, 2003 06:38 pm, David Eisenhart wrote:
> > yeh, I'd agree with this; on your second issue of variable definitions I
do
> > find that being able set the error reporting level to show non critical
> > errors (such as undefined variables) to be a reasonable, although non
> > ideal, compromise; php's still a great language to work with most
respects
> > though ...
> >
> > David Eisenhart
> >
> > "Joshua Moore-Oliva" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > > The only thing I do wish is that there was a way to force php into a
> >
> > typecast
> >
> > > mode...  and possibly a setting to reqiure a definition for a
variable.
> > >
> > > Josh.
>



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




Re: [PHP] Re: Static functions

2003-02-10 Thread Ernest E Vogelsinger
At 22:52 09.02.2003, Chris Hayes said:
[snip]
>At 22:49 9-2-2003, you wrote:
>>yes, you can call a static method on a class by specifying the class name,
>>then 2 colons and finally the function name:
>>
>>classname :: functionname([arg,.])
>>
>>(of course properties can not be accessed by such methods)
>ah ok, cool
[snip] 

With PHP you can also determine if your class method has been called via an
object instance, or class static, by checking the $this reference:

class foo {
function test() {
if (isset($this) && is_object($this) && get_class($this) == 'foo')
echo 'I am a foo object';
else
echo 'I have been called as a "static" method';
}
}

$foo = new foo();
foo::test();
$foo->test();


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Jason Wong
On Monday 10 February 2003 08:45, Joshua Moore-Oliva wrote:
> How would I go about setting the error reporting level?

google > 'php error reporting level'

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Extreme feminine beauty is always disturbing.
-- Spock, "The Cloud Minders", stardate 5818.4
*/


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Joshua Moore-Oliva
How would I go about setting the error reporting level?

Josh.

On February 9, 2003 06:38 pm, David Eisenhart wrote:
> yeh, I'd agree with this; on your second issue of variable definitions I do
> find that being able set the error reporting level to show non critical
> errors (such as undefined variables) to be a reasonable, although non
> ideal, compromise; php's still a great language to work with most respects
> though ...
>
> David Eisenhart
>
> "Joshua Moore-Oliva" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > The only thing I do wish is that there was a way to force php into a
>
> typecast
>
> > mode...  and possibly a setting to reqiure a definition for a variable.
> >
> > Josh.


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Robert Cummings
Chris Hayes wrote:
> 
> At 23:09 9-2-2003, you wrote:
> >you may find the following link interesting
> >http://www.tek271.com/articles/JavaOrPhp.html
> >
> >David Eisenhart
> I cannot suppress the feeling that someone out there has a slight prejudice
> in favour of Java!

God yes, the guy seems to think that OOP is the do all end all style of coding...
personally I like to hybrid OOP and prcoedural concepts which you can't do in
Java. Also lots of other issues that he doesn't take into consideration such
as the task at hand and the appropriateness of one solution over another for
that task.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




Re: [PHP] Re: Static functions

2003-02-09 Thread David Eisenhart
pleasure Leo, happy php'ing !!


"Leo Spalteholz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ah!  thank you very much.  Thats exactly what I was looking for.
>
> Leo
>
> On February 9, 2003 01:49 pm, David Eisenhart wrote:
> > yes, you can call a static method on a class by specifying the
> > class name, then 2 colons and finally the function name:
> >
> > classname :: functionname([arg,.])
> >
> > (of course properties can not be accessed by such methods)
> >
> > David Eisenhart
> >
> >
> >
> > "Leo Spalteholz" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > > Hi, I'm a bit of a newbie to PHP, I've done some stuff in
> > > Java/VB/C++ but I'm having a few problems finding info on this
> > > issue.
> > >
> > > Does PHP support something like static functions in Java?
> > >
> > > for example in Java I can write:
> > >
> > > public class someClass {
> > > public static void someMethod() {}
> > > }
> > >
> > > and then in another file:
> > >
> > > import someClass;
> > >
> > > public class anotherClass {
> > > someClass.someMethod()
> > > }
> > >
> > > Is there some way to access methods of a class without creating
> > > an object in PHP?
> > > Right now I just include the file (not using a class) and then
> > > call the function but I would like to have it more seperate.
> > >
> > > Thanks,
> > > Leo
>



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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread David Eisenhart

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 23:09 9-2-2003, you wrote:
> >you may find the following link interesting
> >http://www.tek271.com/articles/JavaOrPhp.html
> >
> >David Eisenhart
> I cannot suppress the feeling that someone out there has a slight
prejudice
> in favour of Java!
>

'horses for courses' as they say; php is in my case the best fit for my
particular set of needs and circumstances (one big, big advantage being its
MySQL functions and also the ready accessibility of great template libraries
like Smarty)

david











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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread David Eisenhart
yeh, I'd agree with this; on your second issue of variable definitions I do
find that being able set the error reporting level to show non critical
errors (such as undefined variables) to be a reasonable, although non ideal,
compromise; php's still a great language to work with most respects though
...

David Eisenhart

"Joshua Moore-Oliva" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The only thing I do wish is that there was a way to force php into a
typecast
> mode...  and possibly a setting to reqiure a definition for a variable.
>
> Josh.



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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Joshua Moore-Oliva
The only thing I do wish is that there was a way to force php into a typecast 
mode...  and possibly a setting to reqiure a definition for a variable.

Josh.

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




Re: [PHP] Re: Static functions

2003-02-09 Thread Leo Spalteholz
very interesting link.  While some of the cases where he takes java to 
be the winner are simply personal preference, I do agree with most of 
his conclusions.
Best points are the one about declaring variables(3), declaring 
constants(6), using libraries(7), class member scope(17), and 
exception handling(20).  Ok thats my (very unrealistic) wishlist for 
PHP :)

leo

On February 9, 2003 02:09 pm, David Eisenhart wrote:
> you may find the following link interesting
> http://www.tek271.com/articles/JavaOrPhp.html
>
> David Eisenhart


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




Re: [PHP] Re: Static functions

2003-02-09 Thread Leo Spalteholz
ah!  thank you very much.  Thats exactly what I was looking for.

Leo

On February 9, 2003 01:49 pm, David Eisenhart wrote:
> yes, you can call a static method on a class by specifying the
> class name, then 2 colons and finally the function name:
>
> classname :: functionname([arg,.])
>
> (of course properties can not be accessed by such methods)
>
> David Eisenhart
>
>
>
> "Leo Spalteholz" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hi, I'm a bit of a newbie to PHP, I've done some stuff in
> > Java/VB/C++ but I'm having a few problems finding info on this
> > issue.
> >
> > Does PHP support something like static functions in Java?
> >
> > for example in Java I can write:
> >
> > public class someClass {
> > public static void someMethod() {}
> > }
> >
> > and then in another file:
> >
> > import someClass;
> >
> > public class anotherClass {
> > someClass.someMethod()
> > }
> >
> > Is there some way to access methods of a class without creating
> > an object in PHP?
> > Right now I just include the file (not using a class) and then
> > call the function but I would like to have it more seperate.
> >
> > Thanks,
> > Leo


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Chris Hayes
At 23:09 9-2-2003, you wrote:

you may find the following link interesting
http://www.tek271.com/articles/JavaOrPhp.html

David Eisenhart

I cannot suppress the feeling that someone out there has a slight prejudice 
in favour of Java!




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



Re: [PHP] Re: Static functions

2003-02-09 Thread Chris Hayes
At 22:49 9-2-2003, you wrote:

yes, you can call a static method on a class by specifying the class name,
then 2 colons and finally the function name:

classname :: functionname([arg,.])

(of course properties can not be accessed by such methods)

ah ok, cool


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