dynamic_call_001.phpt 457 B

12345678910111213141516171819202122
  1. --TEST--
  2. Testing dynamic call to constructor (old-style)
  3. --FILE--
  4. <?php
  5. class foo {
  6. public function foo() {
  7. }
  8. }
  9. $a = 'foo';
  10. $a::$a();
  11. ?>
  12. --EXPECTF--
  13. Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in %s on line %d
  14. Fatal error: Uncaught Error: Non-static method foo::foo() cannot be called statically in %s:%d
  15. Stack trace:
  16. #0 {main}
  17. thrown in %s on line %d