3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $halls = array( 'North Campus' => array ( 'Edens Hall' => array( 'Floor 1' => 'ea-1net', 'Floor 2' => 'eh-2net', 'Floor 3' => 'eh-3net', 'Floor 4' => 'eh-4net', ), 'Edens North' => array( 'Basement' => 'en-Bnet', 'Floor 1' => 'en-1net', 'Floor 2' => 'en-2net', 'Floor 3' => 'en-3net', 'Floor 4' => 'en-4net', ), 'Higginson' => array( 'Floor 1' => 'hg-1net', 'Floor 2' => 'hg-2net', 'Floor 3' => 'hg-3net', 'Floor 4' => 'hg-4net', 'Floor 5' => 'hg-5net', ), 'Mathes' => array( 'Basement' => 'ma-Bnet', 'Floor 1' => 'ma-1net', 'Floor 2' => 'ma-2net', 'Floor 3' => 'ma-3net', 'Floor 4' => 'ma-4net', 'Floor 5' => 'ma-5net', 'Floor 6' => 'ma-6net', 'Floor 7' => 'ma-7net', 'Floor 8' => 'ma-8net', 'Floor 9' => 'ma-9net', 'Floor 10' => 'ma-10net', ), 'Nash' => array( 'Sub-Basement' => 'na-SBnet', 'Basement' => 'na-Bnet', 'Floor 1' => 'na-1net', 'Floor 2' => 'na-2net', 'Floor 3' => 'na-3net', 'Floor 4' => 'na-4net', 'Floor 5' => 'na-5net', 'Floor 6' => 'na-6net', 'Floor 7' => 'na-7net', ), 'Viking Commons' => array( 'Ground Level' => 'vc-5net', 'Dining Level' => 'vc-6net', # 'Roof' => 'vc-roofnet', ), ), 'Ridgeway Complex' => array( 'Alpha' => array( 'Floor 1' => 'ra-1net', 'Floor 2' => 'ra-2net', 'Floor 3' => 'ra-3net', ), 'Beta' => array( 'Floor 1' => 'rb-1net', 'Floor 2' => 'rb-2net', 'Floor 3' => 'rb-3net', 'Floor 4' => 'rb-4net', ), 'Delta' => array( 'Floor 1' => 'rd-1net', 'Floor 2' => 'rd-2net', 'Floor 3' => 'rd-3net', 'Floor 4' => 'rd-4net', ), 'Gamma' => array( 'Floor 1' => 'rg-1net', 'Floor 2' => 'rg-2net', 'Floor 3' => 'rg-3net', 'Floor 4' => 'rg-4net', ), 'Highland' => array( 'Floor 1' => 'hi-1net', 'Floor 2' => 'hi-2net', 'Main Lounge' => 'hl-1net', ), 'Kappa' => array( 'Floor 1' => 'rk-1net', 'Floor 2' => 'rk-2net', 'Floor 3' => 'rk-3net' 'Floor 4' => 'rk-4net', ), 'Omega' => array( 'Floor 1' => 'ro-1net', 'Floor 2' => 'ro-2net', 'Floor 3' => 'ro-3net', ), 'Sigma' => array( 'Floor 1' => 'rs-1net', 'Floor 2' => 'rs-2net', 'Floor 3' => 'rs-3net', 'Floor 4' => 'rs-4net', 'Floor 5' => 'rs-5net', ), 'Ridgeway Commons' => array( 'Floor 1' => 'rc-1net', 'Dining Floor' => 'rc-2net', ), ), 'South Campus' => array( 'Birnam Wood' => array( # I don't think this was included in the PDF generation #'Site Plan' => 'bwsite', 'Building 1, Floor 1' => 'bw1-1net', 'Building 1, Floor 2' => 'bw1-2net', 'Building 1, Floor 3' => 'bw1-3net', 'Building 2, Floor 1' => 'bw2-1net', 'Building 2, Floor 2' => 'bw2-2net', 'Building 2, Floor 3' => 'bw2-3net', 'Building 3, Floor 1' => 'bw3-1net', 'Building 3, Floor 2' => 'bw3-2net', 'Building 3, Floor 3' => 'bw3-3net', 'Building 4, Floor 1' => 'bw4-1net', 'Building 4, Floor 2' => 'bw4-2net', 'Building 4, Floor 3' => 'bw4-3net', 'Building 5, Floor 1' => 'bw5-1net', 'Building 5, Floor 2' => 'bw5-2net', 'Building 5, Floor 3' => 'bw5-3net', 'Building 6, Floor 1' => 'bw6-1net', 'Building 6, Floor 2' => 'bw6-2net', 'Building 6, Floor 3' => 'bw6-3net', 'Building 7, Floor 1' => 'bw7-1net', 'Building 7, Floor 2' => 'bw7-2net', 'Building 7, Floor 3' => 'bw7-3net', #'Community Building, Floor 1' => 'bw-lng-1', #'Community Building, Floor 2' => 'bw-lng-2web', ), 'Buchanan Towers' => array( # Until Floor 1 is fixed, commenting it out # 'Floor 1' => 'bt-1net', 'Floor 2' => 'bt-2net', 'Floor 3' => 'bt-3net', 'Floor 4' => 'bt-4net', 'Floor 5' => 'bt-5net', 'Floor 6' => 'bt-6net', 'Floor 7' => 'bt-7net', 'Floor 8' => 'bt-8net', ), 'Buchanan Towers East' => array( 'Floor 1' => 'bq-1net', 'Floor 2' => 'bq-2net', 'Floor 3' => 'bq-3net', 'Floor 4' => 'bq-4net', 'Floors 5 and 6' => 'bq-56net', ), 'Fairhaven Complex' => array( 'Stack 1, Floor 1' => 'fx1-1net', 'Stack 1, Floor 2' => 'fx1-2net', 'Stack 1, Floor 3' => 'fx1-3net', 'Stack 1, Floor 4' => 'fx1-4net', 'Stack 2 and 3, Floor 1' => 'fx23-1net', 'Stack 2 and 3, Floor 2' => 'fx23-2net', 'Stack 2 and 3, Floor 3' => 'fx23-3net', 'Stack 2 and 3, Floor 4' => 'fx23-4net', 'Stack 4, Floor 1' => 'fx4-1net', 'Stack 4, Floor 2' => 'fx4-2net', 'Stack 4, Floor 3' => 'fx4-3net', 'Stack 4, Floor 4' => 'fx4-4net', 'Stack 5, Floor 1' => 'fx5-1net', 'Stack 5, Floor 2' => 'fx5-2net', 'Stack 5, Floor 3' => 'fx5-3net', 'Stack 5, Floor 4' => 'fx5-4net', 'Stack 6 and 7, Floor 1' => 'fx67-1net', 'Stack 6 and 7, Floor 2' => 'fx67-2net', 'Stack 6 and 7, Floor 3' => 'fx67-3net', 'Stack 6 and 7, Floor 4' => 'fx67-4net', 'Stack 8, Floor 1' => 'fx8-1net', 'Stack 8, Floor 2' => 'fx8-2net', 'Stack 8, Floor 3' => 'fx8-3net', 'Stack 8, Floor 4' => 'fx8-4net', 'Stack 9 and 10, Floor 1' => 'fx910-1net', 'Stack 9 and 10, Floor 2' => 'fx910-2net', 'Stack 9 and 10, Floor 3' => 'fx910-3net', 'Stack 9 and 10, Floor 4' => 'fx910-4net', 'Stack 11 and 12, Floor 1' => 'fx1112-1net', 'Stack 11 and 12, Floor 2' => 'fx1112-2net', 'Stack 11 and 12, Floor 3' => 'fx1112-3net', 'Stack 11 and 12, Floor 4' => 'fx1112-4net', ), 'Fairhaven Commons' => array( 'Ground Level' => 'fc-1net', 'Dining Level' => 'fc-2net', ), ) ); echo '<div id="floorplan-nav">'; foreach ($halls as $region => $buildings) { echo '<div><p style="font-weight:bold;">'. $region .'</p><ul>'; foreach ($buildings as $hall => $value) { echo '<li><a href="#' . $hall . '">' . $hall . '</a></li>'. "\n"; } echo '</ul></div>'; } echo '<p style="clear:both;"></p></div>'; // Print floorplan list foreach ($halls as $region => $buildings) { echo '<div class="floorplan-list"><h2 style="padding:5px;">'. $region .'</h2>'; foreach ($buildings as $hall => $value) { echo '<p><a style="font-weight: bold;" name="' . $hall . '">' . $hall . '</a></p><ul>'; foreach ($halls[$region][$hall] as $floor => $floorplan) { print '<li><a href="/media/facilities/images/pdf/'. $floorplan .'.pdf" target="_blank">' . $floor . '</a></li>'; // Some floorplans are DWF only } echo '</ul>'; } echo '</div>'; } ?>
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected ''Floor 4'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in /in/gtYIP on line 100
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /in/gtYIP on line 100
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /in/gtYIP on line 100
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/gtYIP on line 100
Process exited with code 255.