3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decodeText($texts) { if(is_array($texts)) { $encoded = array(); foreach($texts as $key => $text) { if (!is_array($key)) { $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 git.master, git.master_jit, rfc.property-hooks
Deprecated: Function utf8_decode() is deprecated in /in/BdVGD on line 12 Deprecated: Function utf8_decode() is deprecated in /in/BdVGD on line 12 Fatal error: Uncaught TypeError: utf8_decode(): Argument #1 ($string) must be of type string, array given in /in/BdVGD:12 Stack trace: #0 /in/BdVGD(12): utf8_decode(Array) #1 /in/BdVGD(28): decodeText(Array) #2 {main} thrown in /in/BdVGD on line 12
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.7 ms | 401 KiB | 8 Q