3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $weather = array('晴れ', '晴れ時々雨', '雪のち雨'); $ary = array( '晴れ' => 'sunny', '雨' => 'rainy', '曇' => 'cloudy', '雪' => 'snowy', 'のち' => 'later', '時々' => 'and' ); for ($i=0; $i < 3; $i++) { //$telop = $weather->forecasts[$i]->telop; $telop = $weather[$i]; foreach ($ary as $key => $value) { $telop = str_replace((string)$key, $ary[$key].' ', $telop); $peace = array_pop(explode(' ', $telop)); } var_dump($peace); }
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 string(0) "" Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 string(0) "" Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 Notice: Only variables should be passed by reference in /in/K7oUH on line 19 string(0) ""
Output for 5.1.0 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 string(0) "" Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 string(0) "" Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 Strict Standards: Only variables should be passed by reference in /in/K7oUH on line 19 string(0) ""
Output for 5.0.5
Fatal error: Only variables can be passed by reference in /in/K7oUH on line 19
Process exited with code 255.
Output for 4.3.0 - 5.0.4
string(0) "" string(0) "" string(0) ""