3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This returns as expected. $str = "\xf8foo"; var_dump( mb_detect_encoding($str, 'UTF-8'), // bool(false) mb_detect_encoding($str, 'UTF-8', true) // bool(false) ); // This does not. $str = "foo\xf8"; var_dump( mb_detect_encoding($str, 'UTF-8'), // string(5) "UTF-8" mb_detect_encoding($str, 'UTF-8', true) // bool(false) ); // Nor does this. $str = "\xe1\xe9\xf3\xfa"; var_dump( mb_detect_encoding($str, 'UTF-8'), // string(5) "UTF-8" mb_detect_encoding($str, 'UTF-8', true) // bool(false) );
Output for git.master, git.master_jit
bool(false) bool(false) string(5) "UTF-8" bool(false) string(5) "UTF-8" bool(false)
Output for rfc.property-hooks
string(5) "UTF-8" bool(false) string(5) "UTF-8" bool(false) string(5) "UTF-8" bool(false)

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.53 ms | 401 KiB | 8 Q