3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $title = 'Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)'; list ($day, $forecast, $maxTitle, $maxTemp, $minTitle, $minTemp) = preg_split('[:,]', $title); list ($highCelsius, $highFarenheit) = explode('(' , $maxTemp); list ($lowCelsius, $lowFarenheit) = explode('(', $minTemp); var_dump(preg_split('[:,]', $title)); var_dump($day, $forecast, $maxTitle, $maxTemp, $minTitle, $minTemp);
based on cO04F
Output for 7.0.0 - 7.1.0
Notice: Undefined offset: 1 in /in/U0hOM on line 5 Notice: Undefined offset: 2 in /in/U0hOM on line 5 Notice: Undefined offset: 3 in /in/U0hOM on line 5 Notice: Undefined offset: 4 in /in/U0hOM on line 5 Notice: Undefined offset: 5 in /in/U0hOM on line 5 Notice: Undefined offset: 1 in /in/U0hOM on line 6 Notice: Undefined offset: 1 in /in/U0hOM on line 7 array(1) { [0]=> string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" } string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" NULL NULL NULL NULL NULL
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: 5 in /in/U0hOM on line 5 Notice: Undefined index: 4 in /in/U0hOM on line 5 Notice: Undefined index: 3 in /in/U0hOM on line 5 Notice: Undefined index: 2 in /in/U0hOM on line 5 Notice: Undefined index: 1 in /in/U0hOM on line 5 Notice: Undefined index: 1 in /in/U0hOM on line 6 Notice: Undefined index: 1 in /in/U0hOM on line 7 array(1) { [0]=> string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" } string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" NULL NULL NULL NULL NULL
Output for 5.3.0 - 5.6.28
Notice: Undefined offset: 5 in /in/U0hOM on line 5 Notice: Undefined offset: 4 in /in/U0hOM on line 5 Notice: Undefined offset: 3 in /in/U0hOM on line 5 Notice: Undefined offset: 2 in /in/U0hOM on line 5 Notice: Undefined offset: 1 in /in/U0hOM on line 5 Notice: Undefined offset: 1 in /in/U0hOM on line 6 Notice: Undefined offset: 1 in /in/U0hOM on line 7 array(1) { [0]=> string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" } string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" NULL NULL NULL NULL NULL
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 5 in /in/U0hOM on line 5 Notice: Undefined offset: 4 in /in/U0hOM on line 5 Notice: Undefined offset: 3 in /in/U0hOM on line 5 Notice: Undefined offset: 2 in /in/U0hOM on line 5 Notice: Undefined offset: 1 in /in/U0hOM on line 5 Notice: Undefined offset: 1 in /in/U0hOM on line 6 Notice: Undefined offset: 1 in /in/U0hOM on line 7 array(1) { [0]=> string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" } string(85) "Wednesday: light rain, Max Temp: 7&#xB0;C (45&#xB0;F), Min Temp: 3&#xB0;C (37&#xB0;F)" NULL NULL NULL NULL NULL