Aer Interpreter Source
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.

43 lines
806 B

  1. class Program {
  2. private int $test = 7;
  3. void testChar(char $value) {
  4. var_dump($value);
  5. var_dump(is_char($value));
  6. }
  7. void testFloat(float $value) {
  8. var_dump($value);
  9. var_dump(is_float($value));
  10. }
  11. void testObject(object $value) {
  12. var_dump($value);
  13. var_dump(is_object($value));
  14. }
  15. void testString(string $value) {
  16. var_dump($value);
  17. var_dump(is_string($value));
  18. }
  19. void testVoid(void $value) {
  20. var_dump($value);
  21. var_dump(is_void($value));
  22. }
  23. public void main() {
  24. object $objval;
  25. void $voidval;
  26. $this->testChar('c');
  27. $this->testChar(NULL);
  28. $this->testFloat(4);
  29. $this->testFloat(56.3);
  30. $this->testObject($objval);
  31. $this->testObject($this);
  32. $this->testString('sample text');
  33. $this->testString(NULL);
  34. $this->testVoid($voidval);
  35. $this->testVoid(NULL);
  36. }
  37. }