3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = "Some test text string with stop-words: stw stw2 stopword stw3stw stopword2c"; $stopwords = array( 'stw', 'stopword' ); $regexp = '/'; $regexp.= '(' . implode('|', $stopwords) . ')' . '/'; var_dump($regexp); mb_ereg_search_init($some_long_text); $totalResult = mb_ereg_search($regexp, "imz"); var_dump($totalResult);
Output for 5.0.4 - 5.1.6, 5.3.0 - 5.6.25, 7.0.0 - 7.1.0
string(16) "/(stw|stopword)/" Notice: Undefined variable: some_long_text in /in/XHehS on line 15 Warning: mb_ereg_search(): No string given in /in/XHehS on line 16 bool(false)
Output for hhvm-3.12.0
string(16) "/(stw|stopword)/" Notice: Undefined variable: some_long_text in /in/XHehS on line 15 Warning: mb_ereg_search_init() expects parameter 1 to be string, null given in /in/XHehS on line 15 Warning: No string given in /in/XHehS on line 16 bool(false)
Output for hhvm-3.10.0
string(16) "/(stw|stopword)/" Notice: Undefined variable: some_long_text in /in/XHehS on line 15 Warning: No string given in /in/XHehS on line 16 bool(false)
Output for 5.2.0 - 5.2.17
string(16) "/(stw|stopword)/" Notice: Undefined variable: some_long_text in /in/XHehS on line 15 bool(false)
Output for 5.0.0 - 5.0.3
string(16) "/(stw|stopword)/" Notice: Undefined variable: some_long_text in /in/XHehS on line 15 Warning: mb_ereg_search(): No string given in /in/XHehS on line 16 bool(false)
Output for 4.3.4 - 4.4.9
string(16) "/(stw|stopword)/" Notice: Undefined variable: some_long_text in /in/XHehS on line 15 bool(false)
Output for 4.3.2 - 4.3.3
string(16) "/(stw|stopword)/" Fatal error: Call to undefined function: mb_ereg_search_init() in /in/XHehS on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(16) "/(stw|stopword)/" Fatal error: Call to undefined function: mb_ereg_search_init() in /in/XHehS on line 15