3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array('assets/image/man.jpg', 'assets/image/violin.jpg', 'assets/image/test.txt'); $images = array(); $images_exts = array('jpg','png'); foreach($input as $value) { echo @end(explode('.', $value)); if(in_array(@end(explode('.', $value)), $images_exts)) { $images[] = $value; } } var_dump($images);
Output for git.master, git.master_jit, rfc.property-hooks
jpgjpgtxtarray(2) { [0]=> string(20) "assets/image/man.jpg" [1]=> string(23) "assets/image/violin.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:
124.65 ms | 405 KiB | 5 Q