3v4l.org

run code in 300+ PHP versions simultaneously
<?php $res = ''; $attributes = explode("||", 'черный==0||зеленый==0||салатовый==0||полированный==0||оранжевый==0||красный==0||белый==0'); $attributes1 = 'черный==0||зеленый==0||салатовый==0||полированный==0||оранжевый==0||красный==0||белый==0'; foreach ($attributes as $value_attribute) { if (!empty($value_attribute)) { //$res .= $value_attribute.'-'; $attributes_delimiter = explode("==", $value_attribute); foreach ($attributes_delimiter as $value_attribute_delimiter) { $res .= $value_attribute_delimiter.'-'; print_r(implode("==", $value_attribute_delimiter); } } else { } } echo $res; $tvs1=explode("||",$attributes1); $tvs2=explode("==",$tvs1); echo '<pre>'; print_r($tvs1); echo '</pre>'; echo '<pre>'; print_r($tvs2); echo '</pre>'; echo '<pre>'; print_r($attributes_delimiter); echo '</pre>';
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.36
Parse error: syntax error, unexpected ';' in /in/dfRQY on line 19
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ';' in /in/dfRQY on line 19
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/dfRQY on line 19
Process exited with code 255.

preferences:
221.02 ms | 1395 KiB | 126 Q