008.phpt 625 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. execute a file with -f
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. if (substr(PHP_OS, 0, 3) == 'WIN') {
  7. die ("skip not for Windows");
  8. }
  9. ?>
  10. --FILE--
  11. <?php
  12. $php = getenv('TEST_PHP_EXECUTABLE');
  13. $filename = dirname(__FILE__).'/008.test.php';
  14. $code ='
  15. <?php
  16. class test {
  17. private $pri;
  18. }
  19. var_dump(test::$pri);
  20. ?>
  21. ';
  22. file_put_contents($filename, $code);
  23. var_dump(`$php -n -f "$filename"`);
  24. var_dump(`$php -n -f "wrong"`);
  25. @unlink($filename);
  26. echo "Done\n";
  27. ?>
  28. --EXPECTF--
  29. string(%d) "
  30. Fatal error: Cannot access private property test::$pri in %s on line %d
  31. "
  32. string(33) "Could not open input file: wrong
  33. "
  34. Done