Skip to content
New issue

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

PHP Extension - Missing Google\Protobuf\Value:has* Methods #20036

Open
FabioBatSilva opened this issue Jan 18, 2025 · 0 comments
Open

PHP Extension - Missing Google\Protobuf\Value:has* Methods #20036

FabioBatSilva opened this issue Jan 18, 2025 · 0 comments
Labels
untriaged auto added to all issues by default when created.

Comments

@FabioBatSilva
Copy link

The PHP C extension implementation is missing has* methods for the Google\Protobuf\Value class that are present in the native PHP implementation.

This creates inconsistency between the two:

PHP Implementation :

C Implementation

static zend_function_entry google_protobuf_Value_phpmethods[] = {
PHP_ME(google_protobuf_Value, __construct, arginfo_construct, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getNullValue, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, setNullValue, arginfo_setter, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getNumberValue, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, setNumberValue, arginfo_setter, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getStringValue, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, setStringValue, arginfo_setter, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getBoolValue, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, setBoolValue, arginfo_setter, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getStructValue, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, setStructValue, arginfo_setter, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getListValue, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, setListValue, arginfo_setter, ZEND_ACC_PUBLIC)
PHP_ME(google_protobuf_Value, getKind, arginfo_void, ZEND_ACC_PUBLIC)
ZEND_FE_END


What version of protobuf and what language are you using?
Version: main
Language: php
OS: Linux

What did you do?

<?php

require_once (dirname(__DIR__) . '/vendor/autoload.php');

use Google\Protobuf\Value;

$v = new Value();

var_dump($v->hasNullValue());
# Compile the extension 
./php/tests/compile_extension.sh

# Run script
php -d display_errors=on -dextension=../ext/google/protobuf/modules/protobuf.so has_value_test.php

What did you expect to see

bool(false)

What did you see instead?

Uncaught Error: Call to undefined method Google\Protobuf\Value::hasNullValue() 
@FabioBatSilva FabioBatSilva added the untriaged auto added to all issues by default when created. label Jan 18, 2025
@FabioBatSilva FabioBatSilva changed the title PHP Extension Missing Google\Protobuf\Value:has* Methods PHP Extension - Missing Google\Protobuf\Value:has* Methods Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged auto added to all issues by default when created.
Projects
None yet
Development

No branches or pull requests

1 participant