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) { var_dump(is_array($key)); var_dump(is_array($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
bool(false) bool(false) bool(false) bool(true) bool(false) bool(false) bool(false) bool(false) array(1) { ["test"]=> string(6) "��l�" } Notice: Undefined variable: text in /in/RQSj0 on line 24 string(0) ""
Output for 4.3.0 - 5.0.3
bool(false) bool(false) bool(false) bool(true) bool(false) bool(false) bool(false) bool(false) array(1) { ["test"]=> string(6) "��l�" } Notice: Undefined variable: text in /in/RQSj0 on line 24 string(0) ""