Category
stdlib · implementation-ready
Problem
mb_strstr() is missing from the VM — function_exists('mb_strstr') returns false and calls fatal with undefined function. Zend provides this in ext/mbstring/mbstring.c.
Sibling functions mb_strpos(), mb_stripos(), mb_strrichr() are all registered; mb_strstr() is the gap.
php-src reference
Repro
<?php
var_dump(mb_strstr('Hello World', 'World')); // string(5) "World"
var_dump(mb_strstr('Hello World', 'World', true)); // string(6) "Hello "
var_dump(mb_strstr('Hello World', 'xyz')); // bool(false)
| Engine |
Result |
| Zend |
Works as above |
| VM |
Fatal: Call to undefined function mb_strstr() |
Scope
ext/mbstring/mb_strstr.php — new builtin using VmMbstring::strpos() + VmString::utf8CharSubstr()
ext/mbstring/Module.php — register
test/compliance/cases/stdlib/mb_strstr.phpt
Done when
Category
stdlib· implementation-readyProblem
mb_strstr()is missing from the VM —function_exists('mb_strstr')returnsfalseand calls fatal with undefined function. Zend provides this inext/mbstring/mbstring.c.Sibling functions
mb_strpos(),mb_stripos(),mb_strrichr()are all registered;mb_strstr()is the gap.php-src reference
ext/mbstring/mbstring.c—PHP_FUNCTION(mb_strstr)Repro
Scope
ext/mbstring/mb_strstr.php— new builtin usingVmMbstring::strpos()+VmString::utf8CharSubstr()ext/mbstring/Module.php— registertest/compliance/cases/stdlib/mb_strstr.phptDone when
mb_strstr()works on VM matching Zend$before_needleand$encodingparams supported