3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = 'chiennes'; if( ($match = substr($data, 0, 5)) == 'chien' || ($match = substr($data, 0, 7)) == 'chienne' ) echo $match, PHP_EOL; // chien if( ($match = substr($data, 0, 7)) == 'chienne' || ($match = substr($data, 0, 5)) == 'chien' ) echo $match, PHP_EOL; // chienne if( ($match = substr($data, 0, 4)) == 'chat' || ($match = substr($data, 0, 8)) == 'chiennes' ) echo $match, PHP_EOL; // chiennes $data = 'un chien et une chienne font des chiots femelles ou mâles selon le chromosome Y qui ne sera pas autrichien ici.'; if(preg_match_all('#\bch(ien|ienne|iot)s?\b#', $data, $match)) { print_r($match[0]); // Array ( [0] => chien [1] => chienne [2] => chiots ) }
Output for git.master, git.master_jit, rfc.property-hooks
chien chienne chiennes Array ( [0] => chien [1] => chienne [2] => chiots )

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