We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I encountered an issue with the __toString method
rust 1.80 ext-php-rs 0.12.0 php 8.3
rust code
use ext_php_rs::{info_table_end, info_table_row, info_table_start, prelude::*}; use ext_php_rs::{exception::PhpResult, types::Zval, zend::ce}; use ext_php_rs::zend::ModuleEntry; #[php_class(name = "Foo")] #[implements(ce::stringable())] #[implements(ce::countable())] #[derive(Default)] pub struct Foo { } #[php_impl] impl Foo { #[constructor] pub fn __construct() -> Self { Foo { } } pub fn __to_string(&self) -> String { format!("string") } pub fn count(&self) -> i32 { 1 } } /// Used by the `phpinfo()` function and when you run `php -i`. pub extern "C" fn php_module_info(_module: *mut ModuleEntry) { info_table_start!(); info_table_row!("Foo", "enabled"); info_table_end!(); } #[php_module] pub fn module(module: ModuleBuilder) -> ModuleBuilder { module }
php code
<?php $foo = new Foo(); echo $foo;
php -d extension=./target/debug/libphp_foo.so test.php PHP Fatal error: Class Foo cannot implement previously implemented interface Stringable in Unknown on line 0 [1] 266183 IOT instruction php -d extension=./target/debug/libphp_foo.so test.php
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
I encountered an issue with the __toString method
rust 1.80
ext-php-rs 0.12.0
php 8.3
rust code
php code
php -d extension=./target/debug/libphp_foo.so test.php
PHP Fatal error: Class Foo cannot implement previously implemented interface Stringable in Unknown on line 0
[1] 266183 IOT instruction php -d extension=./target/debug/libphp_foo.so test.php
The text was updated successfully, but these errors were encountered: