3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Now everything returns as expected. $str = "foo"; var_dump( mb_detect_encoding($str, 'UTF-8, UTF-8'), // string(5) "UTF-8" mb_detect_encoding($str, 'UTF-8, UTF-8', true) // string(5) "UTF-8" ); $str = "\xf8foo"; var_dump( mb_detect_encoding($str, 'UTF-8, UTF-8'), // bool(false) mb_detect_encoding($str, 'UTF-8, UTF-8', true) // bool(false) ); $str = "foo\xf8"; var_dump( mb_detect_encoding($str, 'UTF-8, UTF-8'), // bool(false) mb_detect_encoding($str, 'UTF-8, UTF-8', true) // bool(false) ); $str = "\xe1\xe9\xf3\xfa"; var_dump( mb_detect_encoding($str, 'UTF-8, UTF-8'), // bool(false) mb_detect_encoding($str, 'UTF-8, UTF-8', true) // bool(false) );
Output for git.master, git.master_jit
string(5) "UTF-8" string(5) "UTF-8" bool(false) bool(false) bool(false) bool(false) bool(false) bool(false)
Output for rfc.property-hooks
string(5) "UTF-8" string(5) "UTF-8" 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:
58.92 ms | 401 KiB | 8 Q