PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
nadavvin
Forum Commoner
Posts: 68 Joined: Wed Sep 06, 2006 6:05 am
Post
by nadavvin » Wed Sep 10, 2014 5:54 am
Code: Select all
<?php
class A {
public static function e() {
echo "here\n";
echo isset($this) ? 'This Exist' : 'This Not Exist';
echo "\n";
}
}
$a = new A();
$a->e();
it return This Not Exist
thanks.
Celauran
Moderator
Posts: 6427 Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada
Post
by Celauran » Wed Sep 10, 2014 7:00 am
You don't. What is it you're trying to do?
phpdeveloper1
Forum Newbie
Posts: 19 Joined: Tue Aug 12, 2014 6:13 am
Location: Chennai, India
Post
by phpdeveloper1 » Thu Sep 11, 2014 1:40 am
nadavvin wrote: [
echo isset($this) ? 'This Exist' : 'This Not Exist';
Maybe
self:: would work ?
requinix
Spammer :|
Posts: 6617 Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA
Post
by requinix » Thu Sep 11, 2014 2:16 am
phpdeveloper1 wrote: Maybe self:: would work ?
Nope.