3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_str = "I&#039;ll"; function setup_functions(){ global $smcFunc; $smcFunc = array(); $utf8=1; $ent_list = '&(#\d{1,7}|quot|amp|lt|gt|nbsp);'; $ent_check = array('preg_replace(\'~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~e\', \'$smcFunc[\\\'entity_fix\\\'](\\\'\\2\\\')\', ', ')'); $smcFunc += array( 'entity_fix' => create_function('$string', ' $num = substr($string, 0, 1) === \'x\' ? hexdec(substr($string, 1)) : (int) $string; return $num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num === 0x202E || $num === 0x202D ? \'\' : \'&#\' . $num . \';\';'), 'strlen' => create_function('$string', ' global $smcFunc; return strlen(preg_replace(\'~' . $ent_list . '|.~u' . '\', \'_\', ' . implode('$string', $ent_check) . '));') ); } setup_functions(); echo "Length = " . $smcFunc['strlen']($test_str) . "\n"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function create_function() in /in/7vgnr:13 Stack trace: #0 /in/7vgnr(23): setup_functions() #1 {main} thrown in /in/7vgnr 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:
49.06 ms | 401 KiB | 8 Q