3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sections = array( array( 'name' => 'home', 'uri' => '/', 'title' => 'home'), array( 'name' => 'tech', 'uri' => '/tech', 'title' => 'ux/ui' ), array( 'name' => 'monetization', 'uri' => '/monetization', 'title' => 'monetization' ), array( 'name' => 'contact', 'uri' => '/contact', 'title' => 'contact', 'callToAction' => true, 'desktopTitle' => 'contact us' ), array( 'name' => 'blog', 'uri' => 'https://blog.marfeel.com/blog', 'title' => 'blog', 'external' => true), ); function cmp($a, $b) { if ($a["callToAction"]) { return 1; } return -1; } usort($sections, "cmp");
based on 3EpiH
Output for 7.0.0 - 7.2.0
Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13
Output for 5.5.0 - 5.6.25
Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13 Notice: Undefined index: callToAction in /in/7nEuW on line 13