3v4l.org

run code in 300+ PHP versions simultaneously
<?php $animal = 'dog'; $age = 4; $sentance1 = 'The %s is %d years old'; $result1 = sprintf($sentance1, $animal, $age); $sentance2 = 'Age: %d. Animal: %s'; $result2 = sprintf($sentance2, $age, $animal); $sentance3 = 'Age: %2$d. Animal: %1$s'; $result3 = sprintf($sentance3, $animal, $age); print($result1 . PHP_EOL); print($result2 . PHP_EOL); print($result3 . PHP_EOL);
Output for git.master, git.master_jit, rfc.property-hooks
The dog is 4 years old Age: 4. Animal: dog Age: 4. Animal: dog

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