Test complex expressions.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-04-05 09:43:07 +02:00
parent afe978e366
commit 3359b99128
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,43 @@
class Program {
private const MY_CONST = 12 ^ 0x3FD;
private callback $callback_test = void(){ print("Welcome everyone!\n");};
private static int $value = 4 + 4 * 4;
void callable(callback $callback = void(){ print("Hello world!\n");}) {
$callback();
}
void complexArgs(string $name = 'AerScript' + $this->someStr(), int $age = 10*2+5) {
print("Name = $name\n");
print("Age = $age\n");
}
string someStr() {
return 'ABC';
}
bool someTrue() {
return true;
}
bool someFalse() {
return false;
}
int main() {
static float $f = 4 + 2.4 * 9.1;
var_dump($this->MY_CONST);
var_dump($this->callback_test);
var_dump($this->value);
var_dump($f);
$this->complexArgs();
$this->complexArgs('Me');
$this->callable();
$this->callable(void(){ print("Welcome guest!\n");});
$this->callable($this->callback_test);
$this->someTrue() || print("someTrue() failed\n");
$this->someFalse() || print("someFalse() failed\n");
return 0;
}
}

View File

@ -0,0 +1,12 @@
int(1009)
callback(11 '{closure_1}')
int(20)
float(25.84)
Name = AerScriptABC
Age = 25
Name = Me
Age = 25
Hello world!
Welcome guest!
Welcome everyone!
someFalse() failed