Php 7.3 fix (#5434)
* Inherit from message instead of implement
When regestering class (implmenets other class) during MINIT, zend_class_implements
would call zend_class_entry->interface_gets_implemented(). In PHP-7.3 interface_gets_implemented shares the same location with create_object.
However, during MINIT, the global object storeage hasn't been initialized. And thus, caused segment fault in php 7.3.
* Use zend_string_init where interned string may be the value.
zend_string_dup will keep using the existing interned string.
In php 7.3, interned string cannot be destroyed from user's code.
* Uncommment debug code
* Use latest phpunit for each php versions
* Revert change in Dockerfile
* Update php test to use the new docker image
* Update composer
* Change docker organization
* Update phpunit
* Debug phpunit
* Store phpunit into bin dir in docker image
* Install valgrind to docker
* Fix compatibility test
* Remove generated_service_test from compatibility c extension test
* Update 32bit php test to the new docker image
* Install bison
* Fix build.sh
* Fix DOCKERIMAGE_PREFIX
* Fix basename
* Add comment to build_and_run_docker2.sh
* Remove commented code
* Fix comments
diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php
index 96dad22..38c3809 100644
--- a/php/tests/generated_class_test.php
+++ b/php/tests/generated_class_test.php
@@ -260,12 +260,14 @@
{
$m = new TestMessage();
$m->setOptionalNestedEnum(NestedEnum::ZERO);
+ $this->assertTrue(true);
}
public function testLegacyNestedEnum()
{
$m = new TestMessage();
$m->setOptionalNestedEnum(\Foo\TestMessage_NestedEnum::ZERO);
+ $this->assertTrue(true);
}
public function testLegacyTypehintWithNestedEnums()
@@ -405,6 +407,7 @@
$m = new TestMessage();
$hex = hex2bin("ff");
$m->setOptionalBytes($hex);
+ $this->assertTrue(true);
}
#########################################################
@@ -709,6 +712,8 @@
// test nested messages
$sub = new NoNamespaceMessage\NestedMessage();
$n->setNestedMessage($sub);
+
+ $this->assertTrue(true);
}
public function testEnumWithoutNamespace()
@@ -718,6 +723,7 @@
$repeatedNoNamespaceEnum = $m->getRepeatedNoNamespaceEnum();
$repeatedNoNamespaceEnum[] = NoNameSpaceEnum::VALUE_A;
$m->setRepeatedNoNamespaceEnum($repeatedNoNamespaceEnum);
+ $this->assertTrue(true);
}
#########################################################
@@ -1262,6 +1268,8 @@
$m = \Upper_enum_value\NotAllowed::NULL;
$m = \Upper_enum_value\NotAllowed::VOID;
$m = \Upper_enum_value\NotAllowed::ITERABLE;
+
+ $this->assertTrue(true);
}
#########################################################
@@ -1297,6 +1305,7 @@
{
$m = new testLowerCaseMessage();
$n = testLowerCaseEnum::VALUE;
+ $this->assertTrue(true);
}
#########################################################
@@ -1363,6 +1372,7 @@
]);
TestUtil::assertTestMessage($m);
+ $this->assertTrue(true);
}
#########################################################