3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validate_utf8() { return (bool)preg_match('//u', serialize(func_get_args())); } function test($input) { $output = htmlspecialchars($input, ENT_QUOTES, 'UTF-8'); $code = str_replace('%', '\\x', rawurlencode($input)); if (validate_utf8($input)) { echo "【{$output}】({$code}) は有効なUTF-8シーケンスです。\n"; } else { echo "({$code}) は無効なUTF-8シーケンスです。\n"; } } test("☝( ◠‿◠ )☝"); test("ゔ〲〰"); test("\x0a\x92\xff"); // てきとー test("\xef\xbb\xbf"); // BOMだっけ test(""); // 空文字 echo "\n"; test("\x2f"); // スラッシュ(1バイト) test("\xc0\xaf"); // スラッシュ(冗長2バイト) test("\xe0\x80\xaf"); // スラッシュ(冗長3バイト) test("\xf0\x80\x80\xaf"); // スラッシュ(冗長4バイト)
Output for git.master, git.master_jit, rfc.property-hooks
【☝( ◠‿◠ )☝】(\xE2\x98\x9D\x28\x20\xE2\x97\xA0\xE2\x80\xBF\xE2\x97\xA0\x20\x29\xE2\x98\x9D) は有効なUTF-8シーケンスです。 【ゔ〲〰】(\xE3\x82\x94\xE3\x80\xB2\xE3\x80\xB0) は有効なUTF-8シーケンスです。 (\x0A\x92\xFF) は無効なUTF-8シーケンスです。 【】(\xEF\xBB\xBF) は有効なUTF-8シーケンスです。 【】() は有効なUTF-8シーケンスです。 【/】(\x2F) は有効なUTF-8シーケンスです。 (\xC0\xAF) は無効なUTF-8シーケンスです。 (\xE0\x80\xAF) は無効なUTF-8シーケンスです。 (\xF0\x80\x80\xAF) は無効なUTF-8シーケンスです。

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:
97.82 ms | 402 KiB | 8 Q