3v4l.org

run code in 500+ PHP versions simultaneously
<?php $zip_codes = array( '12556', '765547', '234*', '987*' ); $target_zip = '2347890'; foreach( $zip_codes as $zip ) { echo $zip; if (preg_match('/' . str_replace('*', '.*', $zip) . '/', $target_zip)) { echo ' matched'. PHP_EOL; break; } else { echo ' not matched' . PHP_EOL; } }
Output for git.master, git.master_jit, rfc.property-hooks
12556 not matched 765547 not matched 234* matched

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:
106.25 ms | 1506 KiB | 4 Q