crazywhalecc / static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.
https://static-php.dev
MIT License
1.32k stars 231 forks source link

Sqlsrv extension regression #541

Closed mpociot closed 1 month ago

mpociot commented 2 months ago

I noticed that there is a regression bug that happens as soon as I add sqlsrv to the extension list.

My build command:

export SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -Os" && ./bin/spc build intl,pdo_sqlite,sqlite3,curl,openssl,tokenizer,bcmath,bz2,calendar,dba,ftp,iconv,mysqli,mbstring,mbregex,xml,simplexml,ctype,dom,pdo,filter,session,zlib,fileinfo,pdo_mysql,posix,sockets,shmop,sodium,sysvmsg,sysvsem,sysvshm,gd,zip,gmp,redis,xmlwriter,phar,exif,xmlreader,readline,pcntl,soap,imagick,ffi,password-argon2,pgsql,pdo_pgsql,imap,ldap,xsl,igbinary,zstd,opcache,mongodb --debug --build-cli  --build-fpm --with-libs=nghttp2,liblz4  --debug --no-strip

When running the following code with this PHP binary, you get the correct result 0:

echo str_word_count('мама', 0, null);

When you add sqlsrv and compile a PHP binary, this code breaks and returns 4 instead.

crazywhalecc commented 2 months ago

That's weird. But unfortunately my MacBook was returned for repair. I can only test it on Mac next week. Currently there is no such problem on Linux.

crazywhalecc commented 1 month ago

@mpociot This bug seems to exist on Homebrew's PHP as well, so perhaps track this issue upstream would be better.

mpociot commented 1 month ago

Thank you for tracking this issue down! I'll create an issue on the upstream repository 👍