Timm Friebe

Results 9 comments of Timm Friebe

Everything works fine if I remove the *TestReceiverDestroy* test and move the cleanup code *before* the `c.Destroy()` inside *TestReceiverDefine*: ```diff $ git diff diff --git a/receiver_test.go b/receiver_test.go index 8c662b0..fa3130c 100644...

GDB isn't super helpful as I'm not using a PHP7 library with debug enabled, but here it is anyway: ``` Thread 1 "tests" received signal SIGSEGV, Segmentation fault. tcache_get (tc_idx=1)...

Looks like `php_request_shutdown()`, which is called from Context.Destroy, is causing some parts of what Engine.Define is creating to be removed again, see https://github.com/php/php-src/blob/master/main/main.c#L1952-L1956 (*which even includes a cautionary comment 😜*)...

Another observation: Calling Engine.Define *before* a context has been created also causes a segfault: ```golang package main import ( "fmt" php "github.com/deuill/go-php" "os" ) type Watcher struct { Path string...

From my point of view, this leaves us with the following options: 1. Move `Define()` to Context; make Engine.Define raise a deprecation error. This will result in quite a bit...

Implementation: ```diff diff --git a/src/main/php/lang/ast/emit/PHP.class.php b/src/main/php/lang/ast/emit/PHP.class.php index ac3d93a..79cf654 100755 --- a/src/main/php/lang/ast/emit/PHP.class.php +++ b/src/main/php/lang/ast/emit/PHP.class.php @@ -789,7 +789,15 @@ abstract class PHP extends Emitter { protected function emitAssignment($result, $assignment) { $this->emitAssign($result, $assignment->variable);...

This could also be used to implemented readonly / constant function arguments, as discussed in https://externals.io/message/120615 and https://externals.io/message/120203#120210

## Proof of concept implementation See https://gist.github.com/thekid/dc12c4c4f4cf3f971b7dbbf4a5cd83b4 The property object holds the following: * `name` - property name as a string * `type` - type as a string, may be...

It would be great to have a builtin `Property` class instead of the *stdClass* created by the `(object)` cast. I thought of using the `ReflectionProperty` class here, too. For some...