3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'chat @julio "salut à toi" hey "1 2 3" hoho'; $str = '<?php ' . str_replace( '@', '*', $str ); $a=token_get_all($str); array_shift( $a ); $a = array_column( $a, 1 ); $a = array_map( 'trim', $a ); $a = array_filter( $a ); $a = array_values( $a ); list( $subcommand, $user, $args ) = array_merge( array_splice( $a, 0, 2 ), array_splice( $a, 2 ) ); var_dump($subcommand); var_dump($user); var_dump($args);
Output for git.master, git.master_jit, rfc.property-hooks
string(4) "chat" string(5) "julio" string(7) ""1 2 3""

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:
56.24 ms | 401 KiB | 8 Q