004.phpt 631 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. execute a file with -f
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. ?>
  7. --FILE--
  8. <?php
  9. include "include.inc";
  10. $php = get_cgi_path();
  11. reset_env_vars();
  12. $filename = dirname(__FILE__).'/004.test.php';
  13. $code ='
  14. <?php
  15. class test {
  16. private $pri;
  17. }
  18. var_dump(test::$pri);
  19. ?>
  20. ';
  21. file_put_contents($filename, $code);
  22. var_dump(`$php -n -f "$filename" 2>/dev/null`);
  23. var_dump(`$php -n -f "wrong"`);
  24. @unlink($filename);
  25. echo "Done\n";
  26. ?>
  27. --EXPECTF--
  28. string(%d) "
  29. <br />
  30. <b>Fatal error</b>: Cannot access private property test::$pri in <b>%s004.test.php</b> on line <b>8</b><br />
  31. "
  32. string(25) "No input file specified.
  33. "
  34. Done