3v4l.org

run code in 300+ PHP versions simultaneously
<?php // sample data $_SESSION["products"] = array(); $_SESSION["products"][] = array('vendorid'=>1, 'product_name'=>'TEST31' ); $_SESSION["products"][] = array('vendorid'=>4, 'product_name'=>'TEST21' ); $_SESSION["products"][] = array('vendorid'=>3, 'product_name'=>'TEST20' ); $_SESSION["products"][] = array('vendorid'=>3, 'product_name'=>'TEST17' ); $_SESSION["products"][] = array('vendorid'=>4, 'product_name'=>'TEST11' ); // actual code usort($_SESSION["products"], function($a, $b) { return $a['vendorid'] - $b['vendorid']; }); foreach( $_SESSION["products"] as $product ) { echo '<li>', htmlspecialchars($product['vendorid']), ' ', htmlspecialchars($product['product_name']), "</li>\r\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
<li>1 TEST31</li> <li>3 TEST20</li> <li>3 TEST17</li> <li>4 TEST21</li> <li>4 TEST11</li>

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