3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // $aaa {} $aaa {} // parse it into variables // using php // $aaa {} $aaa {} $text { color: red;} $xfkskhlf {} $string = '$aaa {} $aaa {}'; var_dump(parseString($string)); function parseString($string) { $output = array(); //logic $string = explode("}", $string); foreach ($string as $key->$value) { $output[$key] = $value; } return $output ; }
based on rJvGJ
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: value in /in/8AZLU on line 18 Warning: Creating default object from empty value in /in/8AZLU on line 18 Warning: Illegal offset type in /in/8AZLU on line 19 Notice: Undefined variable: value in /in/8AZLU on line 18 Warning: Illegal offset type in /in/8AZLU on line 19 Notice: Undefined variable: value in /in/8AZLU on line 18 Warning: Illegal offset type in /in/8AZLU on line 19 array(0) { }
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: value in /in/8AZLU on line 18 Warning: Creating default object from empty value in /in/8AZLU on line 18 Fatal error: Uncaught Error: Cannot access empty property in /in/8AZLU:18 Stack trace: #0 /in/8AZLU(11): parseString(Array) #1 {main} thrown in /in/8AZLU on line 18
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Undefined variable: value in /in/8AZLU on line 18 Warning: Creating default object from empty value in /in/8AZLU on line 18 Fatal error: Cannot access empty property in /in/8AZLU on line 18
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Notice: Undefined variable: value in /in/8AZLU on line 18 Strict Standards: Creating default object from empty value in /in/8AZLU on line 18 Fatal error: Cannot access empty property in /in/8AZLU on line 18
Process exited with code 255.