3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT The answer was within her reach. It was hidden in a box and now that box sat directly in front of her. She'd spent years searching for it and could hardly believe she'd finally managed to find it. She turned the key to unlock the box and then gently lifted the top. She held her breath in anticipation of finally knowing the answer she had spent so much of her time in search of. As the lid came off she could see that the box was empty. TEXT; $offsets = array_keys(str_word_count($text, 2)); $totalPerGroup = intdiv(count($offsets), 10); $chunks = array_chunk($offsets, $totalPerGroup); $starts = array_column($chunks, 0); var_export( array_map( fn($start, $end) => substr($text, $start, $end ? $end - $start : $end), $starts, array_slice($starts, 1) + [null] ) );
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
array ( 0 => 'The answer was within her reach. It was ', 1 => 'hidden in a box and now that box ', 2 => 'sat directly in front of her. She\'d spent ', 3 => 'years searching for it and could hardly believe ', 4 => 'she\'d finally managed to find it. She turned ', 5 => 'the key to unlock the box and then ', 6 => 'gently lifted the top. She held her breath ', 7 => 'in anticipation of finally knowing the answer she ', 8 => 'had spent so much of her time in ', 9 => 'search of. As the lid came off she ', 10 => 'could see that the box was empty.', )

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:
27.58 ms | 408 KiB | 5 Q