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 { $this->decodeText($text); } } } else { $encoded = utf8_decode($text); } return $encoded; } $smth = array('test' => 'ääõölö', 'test2' => array('öüõü', 'dasd212äöäöä' )); $smth = decodeText($texts); var_dump($smth); var_dump(decodeText('köõöõüpõ'));
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: texts in /in/NUehr on line 28 Notice: Undefined variable: text in /in/NUehr on line 22 string(0) "" Notice: Undefined variable: text in /in/NUehr on line 22 string(0) ""
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: texts in /in/NUehr on line 28 Notice: Undefined variable: text in /in/NUehr on line 22 string(0) "" Notice: Undefined variable: text in /in/NUehr on line 22 string(0) ""