3v4l.org

run code in 300+ PHP versions simultaneously
<?php function koap2digit($koap){ $o = array('@[^\d\.]@','\.\.'); $n = array('','.'); $digits = preg_replace($o, $n, $koap); $ar = explode('.', $digits); $r = 1000000; foreach($ar as $k => $v) { if($k = 0)$num = $v*100; elseif($k = 1) { $num = ($num+$v)*r; } else { $num += $v*($r/100); } } return $digit; } echo koap2digit('12.21.1 ч.1.1');
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_replace(): Delimiter must not be alphanumeric, backslash, or NUL in /in/YZJaU on line 5 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/YZJaU on line 6 Warning: Undefined variable $num in /in/YZJaU on line 13 Fatal error: Uncaught TypeError: Unsupported operand types: null + string in /in/YZJaU:13 Stack trace: #0 /in/YZJaU(23): koap2digit('12.21.1 \xD1\x87.1.1') #1 {main} thrown in /in/YZJaU on line 13
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:
46.05 ms | 402 KiB | 8 Q