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'; 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>';
based on dfRQY
Output for 5.3.1 - 7.3.0beta1
Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 черный-0-зеленый-0-салатовый-0-полированный-0-оранжевый-0-красный-0-белый-0- Warning: explode() expects parameter 2 to be string, array given in /in/oCUTA on line 31 <pre>Array ( [0] => черный==0 [1] => зеленый==0 [2] => салатовый==0 [3] => полированный==0 [4] => оранжевый==0 [5] => красный==0 [6] => белый==0 ) </pre><pre></pre><pre>Array ( [0] => белый [1] => 0 ) </pre>
Output for 5.2.5 - 5.3.0
Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 Warning: implode(): Invalid arguments passed in /in/oCUTA on line 19 черный-0-зеленый-0-салатовый-0-полированный-0-оранжевый-0-красный-0-белый-0- Notice: Array to string conversion in /in/oCUTA on line 31 <pre>Array ( [0] => черный==0 [1] => зеленый==0 [2] => салатовый==0 [3] => полированный==0 [4] => оранжевый==0 [5] => красный==0 [6] => белый==0 ) </pre><pre>Array ( [0] => Array ) </pre><pre>Array ( [0] => белый [1] => 0 ) </pre>
Output for 4.3.2 - 5.2.4
Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 Warning: implode(): Bad arguments. in /in/oCUTA on line 19 черный-0-зеленый-0-салатовый-0-полированный-0-оранжевый-0-красный-0-белый-0- Notice: Array to string conversion in /in/oCUTA on line 31 <pre>Array ( [0] => черный==0 [1] => зеленый==0 [2] => салатовый==0 [3] => полированный==0 [4] => оранжевый==0 [5] => красный==0 [6] => белый==0 ) </pre><pre>Array ( [0] => Array ) </pre><pre>Array ( [0] => белый [1] => 0 ) </pre>
Output for 4.3.0 - 4.3.1
Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/oCUTA on line 19 черный-0-зеленый-0-салатовый-0-полированный-0-оранжевый-0-красный-0-белый-0- Notice: Array to string conversion in /in/oCUTA on line 31 <pre>Array ( [0] => черный==0 [1] => зеленый==0 [2] => салатовый==0 [3] => полированный==0 [4] => оранжевый==0 [5] => красный==0 [6] => белый==0 ) </pre><pre>Array ( [0] => Array ) </pre><pre>Array ( [0] => белый [1] => 0 ) </pre>