3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$lines = file('your_text_file.txt', FILE_IGNORE_NEW_LINES); $lines = [ '3M Company MMM', '99 Cents Only Stores NDN', 'AO Smith Corporation AOS', 'Aaron\'s, Inc. AAN', ]; foreach ($lines as $line) { [$names[], $symbols[]] = preg_split('~\s+(?=[A-Z]+$)~m', $line); } var_export($names); echo "\n---\n"; var_export($symbols); unset($names, $symbols); echo "\n***\n"; //$text = file_get_contents('your_text_file.txt'); $text = <<<TEXT 3M Company MMM 99 Cents Only Stores NDN AO Smith Corporation AOS Aaron's, Inc. AAN TEXT; preg_match_all('~(.+?)\s+([A-Z]+)$~m', $text, $matches, PREG_SET_ORDER); var_export(array_column($matches, 1)); echo "\n---\n"; var_export(array_column($matches, 2));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => '3M Company', 1 => '99 Cents Only Stores', 2 => 'AO Smith Corporation', 3 => 'Aaron\'s, Inc.', ) --- array ( 0 => 'MMM', 1 => 'NDN', 2 => 'AOS', 3 => 'AAN', ) *** array ( 0 => '3M Company', 1 => '99 Cents Only Stores', 2 => 'AO Smith Corporation', 3 => 'Aaron\'s, Inc.', ) --- array ( 0 => 'MMM', 1 => 'NDN', 2 => 'AOS', 3 => 'AAN', )

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:
35.47 ms | 406 KiB | 5 Q