summaryrefslogtreecommitdiff
path: root/Zend/tests/traits
diff options
context:
space:
mode:
authorPedro Magalhães <mail@pmmaga.net>2017-12-01 16:08:11 +0000
committerNikita Popov <nikita.ppv@gmail.com>2017-12-16 17:07:12 +0100
commit83964e0468e7f4ae39cd1435f3b53f62e174ac21 (patch)
tree0c4c4fa7d5980eec0ff54f711a4824fd809f4222 /Zend/tests/traits
parenta20c9bd3fec9b1df83193ae0db18cb04064461e3 (diff)
downloadphp-git-83964e0468e7f4ae39cd1435f3b53f62e174ac21.tar.gz
Fix #75607 - Check if existing static trait property is a ref before comparing
Diffstat (limited to 'Zend/tests/traits')
-rw-r--r--Zend/tests/traits/bug75607.phpt25
-rw-r--r--Zend/tests/traits/bug75607a.phpt36
2 files changed, 61 insertions, 0 deletions
diff --git a/Zend/tests/traits/bug75607.phpt b/Zend/tests/traits/bug75607.phpt
new file mode 100644
index 0000000000..a3a10425f4
--- /dev/null
+++ b/Zend/tests/traits/bug75607.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #75607 (Comparision of initial static properties failing)
+--FILE--
+<?php
+
+trait T1
+{
+ public static $prop1 = 1;
+}
+
+class Base
+{
+ public static $prop1 = 1;
+}
+
+class Child extends base
+{
+ use T1;
+}
+
+echo "DONE";
+
+?>
+--EXPECT--
+DONE
diff --git a/Zend/tests/traits/bug75607a.phpt b/Zend/tests/traits/bug75607a.phpt
new file mode 100644
index 0000000000..9f5f03521e
--- /dev/null
+++ b/Zend/tests/traits/bug75607a.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #75607 (Comparision of initial static properties failing)
+--FILE--
+<?php
+
+trait T1
+{
+ public static $prop1 = 1;
+}
+
+trait T2
+{
+ public static $prop1 = 1;
+}
+
+class Base
+{
+ use T1;
+}
+
+class Child extends base
+{
+
+}
+
+class Grand extends Child
+{
+ use T2;
+}
+
+$c = new Grand();
+var_dump($c::$prop1);
+
+?>
+--EXPECT--
+int(1)