- FEATURES
- Autoload
- Class Reflection
- Magic Methods
- Exceptions
-
Late Static Binding
- Type Hinting
- SPL
- PHPUNIT
- PHAR
- COMPOSER
- Carbon
- Guzzle
- Faker
- Math
- Requests
- DESIGN PATTERNS
- Singleton Pattern
- Observer Pattern
- Strategy Pattern
- Dependency Injection
- Middleware
- Registry
- SYMFONY
- Routes
- Annotations
- Flex
- Controllers
- Doctrine
- Templating
- VERSIONS
- Php7.4
- Php8.0
- SECURITY
- Filter Input
- Remote Code Injection
- Sql Injection
- Session Fixation
- File Uploads
- Cross Site Scripting
- Spoofed Forms
- CSRF
- Session Hijacking
- MODERN PHP
- Composer
- Autoloader
- Package
- Releases
- Generators
- Dependency Injection
- Middleware
- CUSTOM FRAMEWORK
- App
- Http Foundation
- Front Controller
- Routing
- Render Controller
- Resolver
- SoC
- FRAMEWORKS
- Slim
- Symfony V5
- Laravel V8
- Laminas V3
- Codeigniter V4
LSB
You can't reference the called class in the context of static inheritance. LSB adds a keyword that references the class that was initially called at runtime. Static methods or properties can be access only as part of a class itself.
class Car
{
public static $name = "Car";
public static function getName($self=false)
{
if ($self === true) return self::$name;
return static::$name; // Look Here
}
}
class Toyota extends Car
{
public static $name = "Toyota";
}
$car = new Toyota();
echo Car::$name; // Car
echo $car->name; // Notice:
// Accessing static property Toyota::$name as non static
echo $car->getName(); // Toyota
echo $car->getName(true); // Car
Last update: 531 days ago