diff --git a/examples/lv3_prop.php b/examples/lv3_prop.php new file mode 100644 index 00000000..1dcc3b2b --- /dev/null +++ b/examples/lv3_prop.php @@ -0,0 +1,11 @@ +prop = ['dim2' => ['dim3' => 'value']]; + $o->prop['dim2']['dim3'] = 'hello'; + + var_dump($o); +} + + diff --git a/examples/prop.php b/examples/prop.php new file mode 100644 index 00000000..7365ae9e --- /dev/null +++ b/examples/prop.php @@ -0,0 +1,8 @@ +a = 1024; + $o->a *= 2; + var_dump($o->a); +} \ No newline at end of file diff --git a/tests/zend/grammar/semi_reserved_002.phpt b/tests/zend/grammar/semi_reserved_002.phpt new file mode 100644 index 00000000..bfbd3ef8 --- /dev/null +++ b/tests/zend/grammar/semi_reserved_002.phpt @@ -0,0 +1,245 @@ +--TEST-- +Test semi-reserved words as static class methods +--FILE-- + +--EXPECT-- +Obj::empty +Obj::callable +Obj::class +Obj::trait +Obj::extends +Obj::implements +Obj::static +Obj::abstract +Obj::final +Obj::public +Obj::protected +Obj::private +Obj::const +Obj::enddeclare +Obj::endfor +Obj::endforeach +Obj::endif +Obj::endwhile +Obj::and +Obj::global +Obj::goto +Obj::instanceof +Obj::insteadof +Obj::interface +Obj::namespace +Obj::new +Obj::or +Obj::xor +Obj::try +Obj::use +Obj::var +Obj::exit +Obj::list +Obj::clone +Obj::include +Obj::include_once +Obj::throw +Obj::array +Obj::print +Obj::echo +Obj::require +Obj::require_once +Obj::return +Obj::else +Obj::elseif +Obj::default +Obj::break +Obj::continue +Obj::switch +Obj::yield +Obj::function +Obj::fn +Obj::if +Obj::endswitch +Obj::finally +Obj::for +Obj::foreach +Obj::declare +Obj::case +Obj::do +Obj::while +Obj::as +Obj::catch +Obj::die +Obj::self +Obj::parent +Obj::isset +Obj::unset +Obj::__CLASS__ +Obj::__TRAIT__ +Obj::__FUNCTION__ +Obj::__METHOD__ +Obj::__LINE__ +Obj::__FILE__ +Obj::__DIR__ +Obj::__NAMESPACE__ + +Done diff --git a/tests/zend/heredoc_nowdoc/gh16630.phpt b/tests/zend/heredoc_nowdoc/gh16630.phpt new file mode 100644 index 00000000..62d6c995 --- /dev/null +++ b/tests/zend/heredoc_nowdoc/gh16630.phpt @@ -0,0 +1,19 @@ +--TEST-- +GH-16630 (UAF in lexer with encoding translation and heredocs) +--EXTENSIONS-- +mbstring +--INI-- +zend.multibyte=On +zend.script_encoding=ISO-8859-1 +internal_encoding=EUC-JP +--FILE-- + +--EXPECT-- +heredoc +text diff --git a/tests/zend/heredoc_nowdoc/heredoc_001.phpt b/tests/zend/heredoc_nowdoc/heredoc_001.phpt new file mode 100644 index 00000000..d9d640c3 --- /dev/null +++ b/tests/zend/heredoc_nowdoc/heredoc_001.phpt @@ -0,0 +1,23 @@ +--TEST-- +basic heredoc syntax +--FILE-- + +--EXPECT-- +This is a heredoc test. +This is another heredoc test. diff --git a/tests/zend/heredoc_nowdoc/heredoc_002.phpt b/tests/zend/heredoc_nowdoc/heredoc_002.phpt new file mode 100644 index 00000000..68844a48 --- /dev/null +++ b/tests/zend/heredoc_nowdoc/heredoc_002.phpt @@ -0,0 +1,23 @@ +--TEST-- +basic binary heredoc syntax +--FILE-- + +--EXPECT-- +This is a heredoc test. +This is another heredoc test. diff --git a/tests/zend/heredoc_nowdoc/heredoc_003.phpt b/tests/zend/heredoc_nowdoc/heredoc_003.phpt new file mode 100644 index 00000000..4cc97ba5 --- /dev/null +++ b/tests/zend/heredoc_nowdoc/heredoc_003.phpt @@ -0,0 +1,24 @@ +--TEST-- +simple variable replacement test (heredoc) +--FILE-- + +--EXPECT-- +This is heredoc test #1. +This is heredoc test #2. diff --git a/tests/zend/heredoc_nowdoc/heredoc_004.phpt b/tests/zend/heredoc_nowdoc/heredoc_004.phpt new file mode 100644 index 00000000..f4a67c9f --- /dev/null +++ b/tests/zend/heredoc_nowdoc/heredoc_004.phpt @@ -0,0 +1,24 @@ +--TEST-- +braces variable replacement test (heredoc) +--FILE-- + +--EXPECT-- +This is heredoc test #1. +This is heredoc test #2. diff --git a/tests/zend/heredoc_nowdoc/heredoc_005.phpt b/tests/zend/heredoc_nowdoc/heredoc_005.phpt new file mode 100644 index 00000000..f7fac7ca --- /dev/null +++ b/tests/zend/heredoc_nowdoc/heredoc_005.phpt @@ -0,0 +1,28 @@ +--TEST-- +unbraced complex variable replacement test (heredoc) +--FILE-- + 3, ); + $d = new d; + + print <<d. + + ENDOFHEREDOC; + + $x = <<d. + + ENDOFHEREDOC; + + print "{$x}"; +} +?> +--EXPECTF-- +This is heredoc test #s 1, 2, 3, and 4. +This is heredoc test #s 1, 2, 3, and 4. diff --git a/tests/zend/heredoc_nowdoc/nowdoc.inc b/tests/zend/heredoc_nowdoc/nowdoc.inc new file mode 100644 index 00000000..d2aa5c4a --- /dev/null +++ b/tests/zend/heredoc_nowdoc/nowdoc.inc @@ -0,0 +1,10 @@ + 3, ); +class d { public $d = 4; }; +$d = new d; + +?>