3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST = ['foo'=>"on", 'hop'=>"on", 'bar'=>5]; $protected = $_POST; foreach($protected as $key=>$value) { if($value=="on") { $protected[$key]="1"; } } var_dump($protected);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["foo"]=> string(1) "1" ["hop"]=> string(1) "1" ["bar"]=> int(5) }

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