fork download
  1. <?php
  2.  
  3. public function singleton($key, $value)
  4. {
  5. $this->set($key, function ($c) use ($value) {
  6. static $object;
  7.  
  8. if (null === $object) {
  9. $object = $value($c);
  10. }
  11.  
  12. return $object;
  13. });
  14. }
Runtime error #stdin #stdout #stderr 0.02s 20600KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'public' (T_PUBLIC) in /home/ewsnK8/prog.php on line 3