3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = fopen(".", "r"); $c[$a] = 1; $b =& $c[$a]; $c[$a] =& $b; $c[$a]++; var_dump($c);
based on NYSob
Output for 4.3.2 - 5.2.2, 5.5.24 - 5.6.28, 7.0.0 - 7.1.0
Warning: fopen(.): failed to open stream: Permission denied in /in/7XOtG on line 2 array(1) { [0]=> &int(2) }
Output for hhvm-3.10.0 - 3.12.0
Warning: Permission denied in /in/7XOtG on line 2 array(1) { [0]=> &int(2) }
Output for 5.2.3 - 5.4.45
Strict Standards: Resource ID#5 used as offset, casting to integer (5) in /in/7XOtG on line 3 Strict Standards: Resource ID#5 used as offset, casting to integer (5) in /in/7XOtG on line 4 Strict Standards: Resource ID#5 used as offset, casting to integer (5) in /in/7XOtG on line 5 Strict Standards: Resource ID#5 used as offset, casting to integer (5) in /in/7XOtG on line 6 array(1) { [5]=> &int(2) }
Output for 4.3.0 - 4.3.1
Warning: fopen(.) [http://www.php.net/function.fopen]: failed to create stream: Permission denied in /in/7XOtG on line 2 array(1) { [0]=> &int(2) }