3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compare($left, $right) { if (($length = mb_strlen($left)) != mb_strlen($right)) { return false; } for ($i = 0, $result = 0; $i < $length; $i++) { $result |= ord($left[$i]) ^ ord($right[$i]); } return $result === 0; } var_dump(compare('Ð', 'Â')); var_dump(mb_strlen('Â')); var_dump(strlen('Ð')); var_dump(ord('Ð')); var_dump(ord('Â')); function test($char) { $length = strlen($char); for($i = 0; $i < $length; $i++) { var_dump(ord($char[$i])); } } var_dump(test('Ð'));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) int(1) int(2) int(195) int(195) int(195) int(144) NULL

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