You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
992 B

22 years ago
22 years ago
  1. --TEST--
  2. sqlite-oo: calling static methods
  3. --INI--
  4. sqlite.assoc_case=0
  5. --SKIPIF--
  6. <?php # vim:ft=php
  7. if (!extension_loaded("sqlite")) print "skip";
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once('blankdb_oo.inc');
  12. class foo {
  13. static function bar($param = NULL) {
  14. return $param;
  15. }
  16. }
  17. function baz($param = NULL) {
  18. return $param;
  19. }
  20. var_dump($db->singleQuery("select php('baz')", 1));
  21. var_dump($db->singleQuery("select php('baz', 1)", 1));
  22. var_dump($db->singleQuery("select php('baz', \"PHP\")", 1));
  23. var_dump($db->singleQuery("select php('foo::bar')", 1));
  24. var_dump($db->singleQuery("select php('foo::bar', 1)", 1));
  25. var_dump($db->singleQuery("select php('foo::bar', \"PHP\")", 1));
  26. var_dump($db->singleQuery("select php('foo::bar(\"PHP\")')", 1));
  27. ?>
  28. ===DONE===
  29. --EXPECTF--
  30. NULL
  31. string(1) "1"
  32. string(3) "PHP"
  33. NULL
  34. string(1) "1"
  35. string(3) "PHP"
  36. Warning: SQLiteDatabase::singleQuery(): function `foo::bar("PHP")' is not a function name in %ssqlite_oo_030.php on line %d
  37. bool(false)
  38. ===DONE===