3v4l.org

run code in 300+ PHP versions simultaneously
<?php $roleRequiredToLogin = 'dev-keboola-gcp-us-central1_APP_LoginKeboola'; $projectRole = 'dev-keboola-gcp-us-central1_APP_Keboola'; $orgRole = 'dev-keboola-gcp-us-central1_APP_OrgKeboola'; $strings = [ $roleRequiredToLogin, $projectRole.'_', $orgRole.'_', ]; if (array_unique($strings) !== $strings) { throw new \InvalidArgumentException('The strings must be unique'); } foreach ($strings as $potentialPrefix) { foreach ($strings as $stringToCompareTo) { if ($potentialPrefix === $stringToCompareTo) { continue; } if (strpos($stringToCompareTo, $potentialPrefix) === 0) { throw new \InvalidArgumentException(sprintf( '"%s" is a prefix of "%s"', $potentialPrefix, $stringToCompareTo )); } } } echo 'Success';
Output for git.master, git.master_jit, rfc.property-hooks
Success

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:
96.03 ms | 405 KiB | 5 Q