magic_methods_010.phpt 338 B

123456789101112131415
  1. --TEST--
  2. Testing __toString() declaration with wrong modifier
  3. --FILE--
  4. <?php
  5. class a {
  6. static protected function __toString($a, $b) {
  7. }
  8. }
  9. ?>
  10. --EXPECTF--
  11. Warning: The magic method __toString() must have public visibility and cannot be static in %s on line %d
  12. Fatal error: Method a::__tostring() cannot take arguments in %s on line %d