3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); mb_internal_encoding('utf-8'); $text = "1А роза упала на лапу Азора"; /* $text = "Я иду с мечем судия";*/ $text = "abcdefg"; $text = str_replace(" ", "", $text); $text = mb_strtolower($text); for ($i = 0; $i < mb_strlen($text); $i++) { $symbol1 = mb_substr($text, $i, 1); echo "Symbol1: ".$symbol1."\n"; $symbol2 = mb_substr($text, -$i, 1, 'utf-8'); echo "Symbol2: ".$symbol2."\n"; if ($symbol1 <> $symbol2) { echo "Это не палиндром\n"; $fake = true; break; } } if ($fake <> true) { echo "Это палиндром\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Symbol1: a Symbol2: a Symbol1: b Symbol2: g Это не палиндром

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