3v4l.org

run code in 300+ PHP versions simultaneously
<?php $p = 1; for ($i = 1; $i <= 3; $i++) { echo '$p before calculation: ' . $p . PHP_EOL; for ($k = 1; $k <= $i; $k++) { $p = $p * 3; } echo '$p after calculation: ' . $p . PHP_EOL; } echo '$p at end of script: ' . $p . PHP_EOL; echo '=====' . PHP_EOL; unset($p); // just for having both examples at once for ($i = 1; $i <= 3; $i++) { $p = 1; echo '$p before calculation: ' . $p . PHP_EOL; for ($k = 1; $k <= $i; $k++) { $p = $p * 3; } echo '$p after calculation: ' . $p . PHP_EOL; } echo '$p at end of script: ' . $p . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
$p before calculation: 1 $p after calculation: 3 $p before calculation: 3 $p after calculation: 27 $p before calculation: 27 $p after calculation: 729 $p at end of script: 729 ===== $p before calculation: 1 $p after calculation: 3 $p before calculation: 1 $p after calculation: 9 $p before calculation: 1 $p after calculation: 27 $p at end of script: 27

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:
42.81 ms | 406 KiB | 5 Q