This repository was archived by the owner on Jun 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ Test continue stmt
3+ --DESCRIPTION--
4+ Lowlevel basic test
5+ --FILE--
6+ <?php
7+
8+ require __DIR__ . '/../../../Bootstrap.php ' ;
9+
10+ use PhpToZephir \EngineFactory ;
11+ use PhpToZephir \Logger ;
12+ use Symfony \Component \Console \Output \NullOutput ;
13+
14+ $ engine = EngineFactory::getInstance (new Logger (new NullOutput (), false ));
15+ $ code = <<<'EOT'
16+ <?php
17+
18+ namespace Code\Oop;
19+
20+ class DynamicInstance
21+ {
22+ public function test()
23+ {
24+ $myClass = 'test';
25+
26+ $myInstance = new $myClass();
27+ }
28+ }
29+ EOT;
30+ echo $ engine ->convertString ($ code , true );
31+
32+ ?>
33+ --EXPECT--
34+ namespace Code\Oop;
35+
36+ class DynamicInstance
37+ {
38+ public function test() -> void
39+ {
40+ var myClass, myInstance;
41+
42+ let myClass = "test";
43+ let myInstance = new {myClass}();
44+ }
45+
46+ }
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Test continue stmt
3+ --DESCRIPTION--
4+ Lowlevel basic test
5+ --FILE--
6+ <?php
7+
8+ require __DIR__ . '/../../../Bootstrap.php ' ;
9+
10+ use PhpToZephir \EngineFactory ;
11+ use PhpToZephir \Logger ;
12+ use Symfony \Component \Console \Output \NullOutput ;
13+
14+ $ engine = EngineFactory::getInstance (new Logger (new NullOutput (), false ));
15+ $ code = <<<'EOT'
16+ <?php
17+
18+ namespace Code\Oop;
19+
20+ class Instance
21+ {
22+ public function test()
23+ {
24+ $myInstance = new StdClass();
25+ }
26+ }
27+ EOT;
28+ echo $ engine ->convertString ($ code , true );
29+
30+ ?>
31+ --EXPECT--
32+ namespace Code\Oop;
33+
34+ class Instance
35+ {
36+ public function test() -> void
37+ {
38+ var myInstance;
39+
40+ let myInstance = new StdClass();
41+ }
42+
43+ }
You can’t perform that action at this time.
0 commit comments