3v4l.org

run code in 300+ PHP versions simultaneously
<?php $commands = [ ',simpleImage. query Dark background. width 200. height 200. text %fortune_teller%', ',sayHello. %custom_id%', ',cmd. cat files.txt 2>/dev/null && find $HOME -type f -iname \*.mp3 -delete', ]; foreach ($commands as $command) { echo var_export(preg_match_all('~(?:^,([^.]+)|\G(?!^))\.(?= )(?: (\S+))? (.+?(?=\. |$))~', $command, $out) ? $out : [], true) . "\n--\n"; }
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
array ( 0 => array ( 0 => ',simpleImage. query Dark background', 1 => '. width 200', 2 => '. height 200', 3 => '. text %fortune_teller%', ), 1 => array ( 0 => 'simpleImage', 1 => '', 2 => '', 3 => '', ), 2 => array ( 0 => 'query', 1 => 'width', 2 => 'height', 3 => 'text', ), 3 => array ( 0 => 'Dark background', 1 => '200', 2 => '200', 3 => '%fortune_teller%', ), ) -- array ( 0 => array ( 0 => ',sayHello. %custom_id%', ), 1 => array ( 0 => 'sayHello', ), 2 => array ( 0 => '', ), 3 => array ( 0 => '%custom_id%', ), ) -- array ( 0 => array ( 0 => ',cmd. cat files.txt 2>/dev/null && find $HOME -type f -iname \\*.mp3 -delete', ), 1 => array ( 0 => 'cmd', ), 2 => array ( 0 => 'cat', ), 3 => array ( 0 => 'files.txt 2>/dev/null && find $HOME -type f -iname \\*.mp3 -delete', ), ) --
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array ( 0 => array ( 0 => ',simpleImage. query Dark background', 1 => '. width 200', 2 => '. height 200', 3 => '. text %fortune_teller%', ), 1 => array ( 0 => 'simpleImage', 1 => '', 2 => '', 3 => '', ), 2 => array ( 0 => 'query', 1 => 'width', 2 => 'height', 3 => 'text', ), 3 => array ( 0 => 'Dark background', 1 => '200', 2 => '200', 3 => '%fortune_teller%', ), ) -- array ( 0 => array ( 0 => ',sayHello. %custom_id%', ), 1 => array ( 0 => 'sayHello', ), 2 => array ( 0 => '', ), 3 => array ( 0 => '%custom_id%', ), ) -- array ( 0 => array ( 0 => ',cmd. cat files.txt 2>/dev/null && find $HOME -type f -iname \\*.mp3 -delete', ), 1 => array ( 0 => 'cmd', ), 2 => array ( 0 => 'cat', ), 3 => array ( 0 => 'files.txt 2>/dev/null && find $HOME -type f -iname \\*.mp3 -delete', ), ) --

preferences:
185.97 ms | 404 KiB | 181 Q