3v4l.org

run code in 300+ PHP versions simultaneously
<?php $meals = array ( 'Donna Stephens' => array ( 'BBQ Turkey Meatballs - Lean' => '4', 'Carne Asada Tacos - Lean' => '4', 'Chicken Fajita Bowl - Lean' => '3', 'Sausage Tomato Basil Frittata - Signature' => '4', 'Western Breakfast Quesadilla on Sprouted Sweet Potato Wrap - Signature' => '3', 'Zucchini Noodle Lasagna - Signature' => '3', ), 'Susie Wagner' => array ( 'Chocolate Peanut Butter Pronuts - 3' => '1', 'Smores Protein Bites - 10' => '1', 'Vanilla Pumpkin Pronuts - 6' => '0.5', ), 'Mr. Hirthler' => array ( 'Ground Beef with Brown Rice - Signature' => '3', 'Ground Turkey with Mashed Sweet Potatoes - Signature' => '2', 'Vegetarian Zucchini Noodle Lasagna - Signature' => '2', ), ); echo "==> This works\n"; foreach($meals as $k => &$v){ // Pass by reference echo "checking $k<br>"; print_r($v); } // unset($v); echo "==> This doesn't\n"; foreach($meals as $k => $v){ // Pass by value echo "checking $k<br>"; print_r($v); }
Output for git.master, git.master_jit, rfc.property-hooks
==> This works checking Donna Stephens<br>Array ( [BBQ Turkey Meatballs - Lean] => 4 [Carne Asada Tacos - Lean] => 4 [Chicken Fajita Bowl - Lean] => 3 [Sausage Tomato Basil Frittata - Signature] => 4 [Western Breakfast Quesadilla on Sprouted Sweet Potato Wrap - Signature] => 3 [Zucchini Noodle Lasagna - Signature] => 3 ) checking Susie Wagner<br>Array ( [Chocolate Peanut Butter Pronuts - 3] => 1 [Smores Protein Bites - 10] => 1 [Vanilla Pumpkin Pronuts - 6] => 0.5 ) checking Mr. Hirthler<br>Array ( [Ground Beef with Brown Rice - Signature] => 3 [Ground Turkey with Mashed Sweet Potatoes - Signature] => 2 [Vegetarian Zucchini Noodle Lasagna - Signature] => 2 ) ==> This doesn't checking Donna Stephens<br>Array ( [BBQ Turkey Meatballs - Lean] => 4 [Carne Asada Tacos - Lean] => 4 [Chicken Fajita Bowl - Lean] => 3 [Sausage Tomato Basil Frittata - Signature] => 4 [Western Breakfast Quesadilla on Sprouted Sweet Potato Wrap - Signature] => 3 [Zucchini Noodle Lasagna - Signature] => 3 ) checking Susie Wagner<br>Array ( [Chocolate Peanut Butter Pronuts - 3] => 1 [Smores Protein Bites - 10] => 1 [Vanilla Pumpkin Pronuts - 6] => 0.5 ) checking Mr. Hirthler<br>Array ( [Chocolate Peanut Butter Pronuts - 3] => 1 [Smores Protein Bites - 10] => 1 [Vanilla Pumpkin Pronuts - 6] => 0.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:
82.98 ms | 1788 KiB | 4 Q