fork download
  1. <?php
  2.  
  3. class Crypto {
  4. public function check() {
  5. echo __METHOD__;
  6. }
  7. }
  8.  
  9. class Check {
  10. public static $crypto;
  11.  
  12. public function __construct() {
  13. self::$crypto = new Crypto;
  14. }
  15.  
  16. public function check() {
  17. $this->crypto->check();
  18. }
  19. }
  20.  
  21. (new Check)->check();
Runtime error #stdin #stdout #stderr 0.02s 24412KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Accessing static property Check::$crypto as non static in /home/wfIBX7/prog.php on line 17
PHP Notice:  Undefined property: Check::$crypto in /home/wfIBX7/prog.php on line 17
PHP Fatal error:  Uncaught Error: Call to a member function check() on null in /home/wfIBX7/prog.php:17
Stack trace:
#0 /home/wfIBX7/prog.php(21): Check->check()
#1 {main}
  thrown in /home/wfIBX7/prog.php on line 17