3v4l.org

run code in 300+ PHP versions simultaneously
<?php $food = array('fruits' => array('item1'=>'orange', 'item2'=>'banana', 'item3'=>'apple'), 'veggie' => array('item1'=>'carrot', 'item2'=>'collard', 'item3'=>'pea')); print_r($food); foreach($food as $item) { echo $item["item1"]."<br >"; } if(in_array('orange', $food, true)){ echo 'in array'; } else { echo 'not in array'; } $test_array=null; echo count($test_array)."count of food "; echo strlen("");
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [fruits] => Array ( [item1] => orange [item2] => banana [item3] => apple ) [veggie] => Array ( [item1] => carrot [item2] => collard [item3] => pea ) ) orange<br >carrot<br >not in array Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/RJJOr:16 Stack trace: #0 {main} thrown in /in/RJJOr on line 16
Process exited with code 255.

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:
62.59 ms | 402 KiB | 8 Q