3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '1_10_10-Einzel.pdf'; var_export( preg_split('/[-_.]/', $str) ); echo "\n---\n"; var_export( preg_split('/-|_|\./', $str) ); echo "\n---\n"; var_export( preg_split('%[-_.]+%', $str) ); echo "\n---\n"; var_export( preg_split("/[-_.]+/", $str, 0, PREG_SPLIT_NO_EMPTY) ); echo "\n---\n"; var_export( preg_split('@[-_.]+@', $str, flags: PREG_SPLIT_NO_EMPTY) ); echo "\n---\n"; $args = [ 'pattern' => '#[-_.]+#', 'subject' => $str, 'flags' => PREG_SPLIT_NO_EMPTY, ]; var_export( preg_split(...$args) );
Output for git.master_jit, git.master
array ( 0 => '1', 1 => '10', 2 => '10', 3 => 'Einzel', 4 => 'pdf', ) --- array ( 0 => '1', 1 => '10', 2 => '10', 3 => 'Einzel', 4 => 'pdf', ) --- array ( 0 => '1', 1 => '10', 2 => '10', 3 => 'Einzel', 4 => 'pdf', ) --- array ( 0 => '1', 1 => '10', 2 => '10', 3 => 'Einzel', 4 => 'pdf', ) --- array ( 0 => '1', 1 => '10', 2 => '10', 3 => 'Einzel', 4 => 'pdf', ) --- array ( 0 => '1', 1 => '10', 2 => '10', 3 => 'Einzel', 4 => 'pdf', )

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:
45.03 ms | 746 KiB | 4 Q