Try the following:
class Foo {
function bar() {
$static = !(isset($this) && $this instanceof self);
}
}
Source: seancoates.com via Google
More Related Contents:
- How to get static data member from php object instance? [closed]
- How to set php class attribute?
- What’s wrong with using $_REQUEST[]?
- New self vs. new static
- Declaration of Methods should be Compatible with Parent Methods in PHP
- Calling non-static method with double-colon(::)
- Why does PHP 5.2+ disallow abstract static class methods?
- Redefine Class Methods or Class
- Passing an Array as Arguments, not an Array, in PHP
- Difference between method calls $model->relation(); and $model->relation;
- array_unique for objects?
- `static` keyword inside function?
- Is it possible to create static classes in PHP (like in C#)?
- Non-static method ….. should not be called statically
- PHP static variables in double quotes
- Static variables in PHP
- When do I use static variables/functions in php?
- Create an order programmatically with line items in Woocommerce 3+
- Getting static property from a class with dynamic class name in PHP
- How is testing the registry pattern or singleton hard in PHP?
- How to add a new method to a php object on the fly?
- PHP: Static and non Static functions and Objects
- codeigniter check for user session in every controller
- Get refunded orders and refunded order items details in Woocommerce 3
- Calling a function within a Class method?
- Static class initializer in PHP
- How do I access static member of a class?
- Method Chains PHP OOP
- Public static variable value
- php static function