3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($str){ if(preg_match('#^869\d{11}$#', $str)) { $arr = str_split(substr($str, 0,13)); $even = $odd = $num = 0; foreach ($arr as $key => $value) { if($key % 2 == 0) { $even += $value; } else { $odd += $value; } } $even *= 3; $num = $even + $odd; $num = strval($num); $res = $num{strlen($num) -1}; if($res == 0 && $str[13] == 0) { return '匹配成功'; } else if ($str[13] == (10 - $res)) { return '匹配成功'; } else{ return '匹配失败'; } } else{ return '匹配失败'; } } echo check('86912345543213');
Output for git.master, git.master_jit
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/5uPfW on line 17
Process exited with code 255.
Output for rfc.property-hooks
Parse error: syntax error, unexpected token "{" in /in/5uPfW on line 17
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.67 ms | 401 KiB | 8 Q