[php-src] PR #14609: FFI add get value of the pointer variable
| From: | chopins | Date: | Thu, 20 Jun 2024 04:04:46 +0000 |
| Subject: | [php-src] PR #14609: FFI add get value of the pointer variable | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-26740@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/14609
Author: chopins
Get value of the pointer variable, smailer:
```c
int foo() {
int a = 1;
int* ptr = &a;
return ptr;
}
```
in php
```php
$x = FFI::cdef()->cast("void*", 20);
$v = FFI::addrValue($x);
var_dump($v);// output 20
```