3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = 'http://cdn.videourl.mp4?expire=1635939248&token=7022dbc14de970c7uc040ac4f35058f0 http://cdn.videourl.mp4?token=7022dbc14de970c7uc040ac4f35058f0&expire=1635939248'; preg_match_all('/http\S*?\.mp4\?(?:expire=(?P<expire>[0-9]+)&token=(?P<token>[0-9a-z]+)|token=(?P<token>[0-9a-z]+)&expire=(?P<expire>[0-9]+))/J', $html, $posts, // will contain the article data PREG_SET_ORDER // formats data into an array of posts ); var_dump($posts);
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.4, 8.3.6 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.7
array(2) { [0]=> array(5) { [0]=> string(80) "http://cdn.videourl.mp4?expire=1635939248&token=7022dbc14de970c7uc040ac4f35058f0" ["expire"]=> string(10) "1635939248" [1]=> string(10) "1635939248" ["token"]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" [2]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" } [1]=> array(7) { [0]=> string(80) "http://cdn.videourl.mp4?token=7022dbc14de970c7uc040ac4f35058f0&expire=1635939248" ["expire"]=> string(10) "1635939248" [1]=> string(0) "" ["token"]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" [2]=> string(0) "" [3]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" [4]=> string(10) "1635939248" } }
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(2) { [0]=> array(5) { [0]=> string(80) "http://cdn.videourl.mp4?expire=1635939248&token=7022dbc14de970c7uc040ac4f35058f0" ["expire"]=> string(10) "1635939248" [1]=> string(10) "1635939248" ["token"]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" [2]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" } [1]=> array(7) { [0]=> string(80) "http://cdn.videourl.mp4?token=7022dbc14de970c7uc040ac4f35058f0&expire=1635939248" ["expire"]=> string(10) "1635939248" [1]=> string(0) "" ["token"]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" [2]=> string(0) "" [3]=> string(32) "7022dbc14de970c7uc040ac4f35058f0" [4]=> string(10) "1635939248" } }

preferences:
287.22 ms | 1577 KiB | 4 Q