self_static - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of self_static.php
- <?php
- abstract class A
- {
- const TEST = "test";
- abstract public static function testFunc();
- public function testFunc2()
- {
- return self::TEST."_".static::testFunc();
- }
- }
- class B extends A
- {
- public function accessConst()
- {
- return self::TEST;
- }
- public static function testFunc()
- {
- return "Document";
- }
- }
- $b = new B();
- echo $b->testFunc2();
- //echo $b->accessConst();
File Description
- self_static
- PHP Code
- 22 Dec-2022
- 447 Bytes
You can Share it:
Latest PHP Pastes