3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $health = array('healthy', 'fit', 'happy'); $wealth = array('Bank Account' => 15000000, 'House' => 'Mansion on the water','Net Worth' => '65000000 net worth'); $stuff = array('cars'=> array('Ferrari California','Lexus RC', 'Mercedes AMG', 'Range Rover'), 'toys'=> array('yacht', 'jet skis','private jet','pool house','man cave', 'vacation homes', 'spa', 'golf', 'bbqs', 'private dinners', 'f cups')); $relationships = array('danee', 'family', 'friends', 'universe', 'my creator'); $success = array('famous', 'billion dollar business', 'ceo', 'actor', 'opportunities', 'investments'); $myLife = array('health' => $health,'wealth' => $wealth, 'relationships' => $relationships, 'success' => $success, 'stuff' => $stuff); function element($array) { for ($i=0; $i < count($array); $i++) { echo $array[$i] . ', '; } } echo 'I have an amazing life.</br></br>'; echo 'In health, ' . 'I have ' ; for($i=0;$i<count($health); $i++) { echo $health[$i] . ', '; } echo '</br></br>'; echo 'In wealth, I have ' ; foreach($wealth as $element=>$what){ echo $what . ', '; } echo '</br></br>'; echo 'In relationships, I have '; for($i=0;$i<count($relationships); $i++) { echo $relationships[$i] . ', ';} echo '</br></br>'; echo 'In success, I have '; for($i=0;$i<count($success); $i++) { echo $success[$i] . ', ';} echo '</br></br>';
Output for 5.3.18 - 7.3.0rc3
I have an amazing life.</br></br>In health, I have healthy, fit, happy, </br></br>In wealth, I have 15000000, Mansion on the water, 65000000 net worth, </br></br>In relationships, I have danee, family, friends, universe, my creator, </br></br>In success, I have famous, billion dollar business, ceo, actor, opportunities, investments, </br></br>