3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function decodeText($texts) { if(is_array($texts)) { $encoded = array(); foreach($texts as $key => $text) { if (!is_array($text )) { $encoded[$key] = utf8_decode($text); } else { decodeText($text); } } } else { $encoded = utf8_decode($text); } return $encoded; } $smth = array('test' => 'ääõölö', 'test2' => array('öüõü', 'dasd212äöäöä' )); $smth = decodeText($smth); var_dump($smth); var_dump(decodeText('köõöõüpõ'));
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { ["test"]=> string(6) "��l�" } Notice: Undefined variable: text in /in/ZSMFM on line 22 string(0) ""
Output for 4.3.0 - 5.0.3
array(1) { ["test"]=> string(6) "��l�" } Notice: Undefined variable: text in /in/ZSMFM on line 22 string(0) ""