3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'chat @julio "salut à toi" hey "1 2 3"'; $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 ) = $input = array("red", "green", "blue", "yellow"); var_dump($a); var_dump( $input ); array_splice($input, 2); var_dump( $input ); var_dump( array_splice( $a, 2 ) ); var_dump($subcommand); var_dump($user); var_dump($args);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> string(4) "chat" [1]=> string(5) "julio" [2]=> string(14) ""salut à toi"" [3]=> string(3) "hey" [4]=> string(7) ""1 2 3"" } array(4) { [0]=> string(3) "red" [1]=> string(5) "green" [2]=> string(4) "blue" [3]=> string(6) "yellow" } array(2) { [0]=> string(3) "red" [1]=> string(5) "green" } array(3) { [0]=> string(14) ""salut à toi"" [1]=> string(3) "hey" [2]=> string(7) ""1 2 3"" } Warning: Undefined variable $subcommand in /in/VcmZR on line 18 NULL Warning: Undefined variable $user in /in/VcmZR on line 19 NULL Warning: Undefined variable $args in /in/VcmZR on line 20 NULL

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:
87.83 ms | 402 KiB | 8 Q