diff --git a/tests/aot/magic-constants.phpt b/tests/aot/magic-constants.phpt new file mode 100644 index 00000000..4eb02b1c --- /dev/null +++ b/tests/aot/magic-constants.phpt @@ -0,0 +1,37 @@ +--TEST-- +Magic constants: __LINE__, __FILE__, __DIR__, __FUNCTION__, __METHOD__, __CLASS__ +--FILE-- +testMethod(); +} + +?> +--EXPECTF-- +__LINE__: int(%d) +__FILE__: string(%d) "magic-constants.php" +__DIR__: string(%d) "aot" +__FUNCTION__ in function: string(%d) "testFunction" +__METHOD__: string(%d) "TestMagicConst::testMethod" +__CLASS__: string(%d) "TestMagicConst" +__FUNCTION__: string(%d) "testMethod" diff --git a/tests/aot/string-interpolation.phpt b/tests/aot/string-interpolation.phpt new file mode 100644 index 00000000..280efc76 --- /dev/null +++ b/tests/aot/string-interpolation.phpt @@ -0,0 +1,38 @@ +--TEST-- +String interpolation with complex expressions +--FILE-- +name = $name; + } +} + +function main() { + $count = 5; + $arr = [1, 2, 3]; + + // Simple variable interpolation + $s1 = "count is $count"; + var_dump($s1); + + // Array access interpolation + $s2 = "first: {$arr[0]}, last: {$arr[2]}"; + var_dump($s2); + + // Property access interpolation + $person = new Person("Alice"); + $s3 = "Name: {$person->name}"; + var_dump($s3); + + echo "done\n"; +} + +?> +--EXPECT-- +string(10) "count is 5" +string(17) "first: 1, last: 3" +string(11) "Name: Alice" +done diff --git a/tests/aot/variable-functions.phpt b/tests/aot/variable-functions.phpt new file mode 100644 index 00000000..a786e9c1 --- /dev/null +++ b/tests/aot/variable-functions.phpt @@ -0,0 +1,41 @@ +--TEST-- +Variable functions +--FILE-- + +--EXPECT-- +string(12) "Hello, World" +int(10) +int(4) +int(30) +done diff --git a/tests/aot/variable-variables.phpt b/tests/aot/variable-variables.phpt new file mode 100644 index 00000000..8ae99819 --- /dev/null +++ b/tests/aot/variable-variables.phpt @@ -0,0 +1,16 @@ +--TEST-- +Variable variables ($$var) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(5) "world"