3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['a' => 'a', 'b' => 'b']; foreach ($a as &$value) { $value = 'C'; } $value = 'D'; //$value is still bound by-reference echo 'Unintended Results: ' . PHP_EOL; var_dump($a); echo PHP_EOL; $a = ['a' => 'a', 'b' => 'b']; foreach ($a as &$value) { $value = 'C'; } unset($value); $value = 'D'; echo 'Expected Results: ' . PHP_EOL; var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
Unintended Results: array(2) { ["a"]=> string(1) "C" ["b"]=> &string(1) "D" } Expected Results: array(2) { ["a"]=> string(1) "C" ["b"]=> string(1) "C" }

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