3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categories=Array ( "1" => "Accounting & Financial", "2" => "Advertising Services", "3" => "Awards & Incentives", "4" => "Business Consultants", "5" => "Career Services", "6" => "Creative Services", "7" => "Data Management", "8" => "Distributors & Agents" ) ; $Service_Provider_Id = Array ( "0" => Array ( "id" => "1" , "category" => "Accounting & Financial" ), "1" => Array ( "id" => "2", "category" => "Advertising Services" ) ); foreach ($categories as $key => $value) { //echo $value."<br>"; if(in_array("Accounting & Financial",$Service_Provider_Id['category'])) echo "123"; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "category" in /in/tqudq on line 32 Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /in/tqudq:32 Stack trace: #0 /in/tqudq(32): in_array('Accounting & Fi...', NULL) #1 {main} thrown in /in/tqudq on line 32
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:
49.52 ms | 401 KiB | 8 Q