3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ords_to_unistr($ords, $encoding = 'UTF-8'){ // Turns an array of ordinal values into a string of unicode characters $str = ''; for($i = 0; $i < sizeof($ords); $i++){ // Pack this number into a 4-byte string // (Or multiple one-byte strings, depending on context.) $v = $ords[$i]; $str .= pack("N",$v); } $str = mb_convert_encoding($str,$encoding,"UCS-4BE"); return($str); } echo ords_to_unistr(239);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, int given in /in/TRaUl:5 Stack trace: #0 /in/TRaUl(15): ords_to_unistr(239) #1 {main} thrown in /in/TRaUl on line 5
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:
62.62 ms | 401 KiB | 8 Q