3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Bla { function __construct() { $data = array('foo' => 'bläa ,.,. blubb'); var_dump($this->_parseResults($data)); } function _parseResults($results) { foreach ($results as $key => $result) { $results[$key] = trim(preg_replace('/[^a-zA-Z0-9-_. ]/', '', $result)); } return $results; } } new Bla();
based on hlkAt
Output for 5.0.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(1) { ["foo"]=> string(12) "bla .. blubb" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.4.9