3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text="one #two three #four #five"; $parts = explode(' ', $text); $parts = array_filter( function($word) {return strpos("#",$word)!==1;}, $array ); print_r($parts);
based on EgSjJ
Output for 7.0.19 - 7.0.20, 7.1.5 - 7.3.0alpha1
Notice: Undefined variable: array in /in/KEhZI on line 7 Warning: array_filter() expects parameter 1 to be array, object given in /in/KEhZI on line 7
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.4
Notice: Undefined variable: array in /in/KEhZI on line 6 Warning: array_filter() expects parameter 1 to be array, object given in /in/KEhZI on line 6
Output for hhvm-3.15.4
Notice: Undefined variable: array in /in/KEhZI on line 8 Warning: array_filter() expects parameter 1 to be an array or collection in /in/KEhZI on line 8
Output for 5.6.0 - 5.6.30
Notice: Undefined variable: array in /in/KEhZI on line 8 Warning: array_filter() expects parameter 1 to be array, object given in /in/KEhZI on line 8