3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(array('errors' => array(), 'path' => '/some/path/to/a/file.jpg'), array('errors' => array(), 'path' => '/yet/another/path.jpg')); var_dump($a); foreach ($a as $k -> $v) echo $k, $v, "<br>";
Output for 7.1.0
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Warning: Creating default object from empty value in /in/M7CQu on line 4 Recoverable fatal error: Object of class stdClass could not be converted to string in /in/M7CQu on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.14
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Warning: Creating default object from empty value in /in/M7CQu on line 4 Fatal error: Uncaught Error: Cannot access empty property in /in/M7CQu:4 Stack trace: #0 {main} thrown in /in/M7CQu on line 4
Process exited with code 255.
Output for 5.4.0 - 5.6.28
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Warning: Creating default object from empty value in /in/M7CQu on line 4 Fatal error: Cannot access empty property in /in/M7CQu on line 4
Process exited with code 255.
Output for 5.1.0 - 5.3.29
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Strict Standards: Creating default object from empty value in /in/M7CQu on line 4 Fatal error: Cannot access empty property in /in/M7CQu on line 4
Process exited with code 255.
Output for 5.0.5
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Fatal error: Cannot access empty property in /in/M7CQu on line 4
Process exited with code 255.
Output for 5.0.4
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Object id #1 Notice: Undefined variable: v in /in/M7CQu on line 4 <br> Notice: Undefined variable: v in /in/M7CQu on line 4 Object id #1 Notice: Undefined variable: v in /in/M7CQu on line 4 <br>
Output for 5.0.0 - 5.0.3
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Object id #1 Notice: Undefined variable: v in /in/M7CQu on line 4 <br> Notice: Undefined variable: v in /in/M7CQu on line 4 Object id #1 Notice: Undefined variable: v in /in/M7CQu on line 4 <br>
Output for 4.3.0 - 4.4.9
array(2) { [0]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(24) "/some/path/to/a/file.jpg" } [1]=> array(2) { ["errors"]=> array(0) { } ["path"]=> string(21) "/yet/another/path.jpg" } } Notice: Undefined variable: v in /in/M7CQu on line 4 Object Notice: Undefined variable: v in /in/M7CQu on line 4 <br> Notice: Undefined variable: v in /in/M7CQu on line 4 Object Notice: Undefined variable: v in /in/M7CQu on line 4 <br>