3v4l.org

run code in 300+ PHP versions simultaneously
<?php $projPicsList = [ 'foobar_1.jpg', 'foobar_2.jpg', 'foobar_12.jpg', 'foobar_th1.jpg', 'foobar_th2.jpg', 'sdfaso234_33.jpg', 'foobar_th12.jpg', 'foobar_th32.jpg', 'fsdfas_th56.jpg', 'sdfiweflsdfasd24sdfsd_sdfse_th67.jpg', ]; /* $thumbs = []; foreach($projPicsList as $file) { if(preg_match('/.*_th\d+\.jpg$/' , $file)) { $thumbs[] = $file; } }*/ $thumbs = array_filter($projPicsList, function($item){ return preg_match('/.*_th\d+\.jpg$/' , $item); }); print_r($thumbs);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [3] => foobar_th1.jpg [4] => foobar_th2.jpg [6] => foobar_th12.jpg [7] => foobar_th32.jpg [8] => fsdfas_th56.jpg [9] => sdfiweflsdfasd24sdfsd_sdfse_th67.jpg )

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:
31.23 ms | 401 KiB | 8 Q