3v4l.org

run code in 300+ PHP versions simultaneously
<?php function startsWith($haystack, $needle) { $cutsQuantity = 2; $parts = explode($needle, $haystack, $cutsQuantity); return ($parts[0] === ''); } function endsWith($haystack, $needle) { $parts = explode($needle, $haystack); return (array_pop($parts) === ''); } var_dump(startsWith('The quick brown fox jumps over the lazy dog', 'The quick')); // true var_dump(startsWith('The quick brown fox jumps over the lazy dog', 'lazy dog')); // false var_dump(endsWith('The quick brown fox jumps over the lazy dog', 'The quick')); // false var_dump(endsWith('The quick brown fox jumps over the lázy dog', 'lázy dog')); // true
Output for git.master_jit, git.master, rfc.property-hooks
bool(true) bool(false) bool(false) bool(true)

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