3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $res = ''; $attributes = explode("||", 'черный==0||зеленый==0||салатовый==0||полированный==0||оранжевый==0||красный==0||белый==0'); $attributes1 = 'черный==0||зеленый==0||салатовый==0||полированный==0||оранжевый==0||красный==0||белый==0'; $tvs1 = explode("||", $attributes1); $value_attribute_delimiter = ''; foreach ($tvs1 as $value_attribute_delimiter) { $arr .= explode("==", $value_attribute_delimiter); $vlb .= $value_attribute_delimiter.'-'; $value = ''; } //echo $vlb; //print_r($arr); foreach ($arr as $value) { echo $value.'-'; }
based on nRUFh
Output for 5.4.0 - 7.3.0beta1
Notice: Undefined variable: arr in /in/SmRhF on line 13 Notice: Array to string conversion in /in/SmRhF on line 13 Notice: Undefined variable: vlb in /in/SmRhF on line 15 Notice: Array to string conversion in /in/SmRhF on line 13 Notice: Array to string conversion in /in/SmRhF on line 13 Notice: Array to string conversion in /in/SmRhF on line 13 Notice: Array to string conversion in /in/SmRhF on line 13 Notice: Array to string conversion in /in/SmRhF on line 13 Notice: Array to string conversion in /in/SmRhF on line 13 Warning: Invalid argument supplied for foreach() in /in/SmRhF on line 23
Output for 5.0.4 - 5.3.29
Notice: Undefined variable: arr in /in/SmRhF on line 13 Notice: Undefined variable: vlb in /in/SmRhF on line 15 Warning: Invalid argument supplied for foreach() in /in/SmRhF on line 23
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.3
Notice: Undefined variable: arr in /in/SmRhF on line 13 Notice: Undefined variable: vlb in /in/SmRhF on line 15 Warning: Invalid argument supplied for foreach() in /in/SmRhF on line 23
Output for 4.3.11
Notice: Undefined variable: arr in /in/SmRhF on line 13 Notice: Undefined variable: vlb in /in/SmRhF on line 15