3v4l.org

run code in 200+ PHP versions simultaneously
<?php $a = array(); $a[] = &$a; preg_grep('/abc/', $a); var_dump($a); ?>
based on QdmMl
Output for 5.2.14 - 5.2.17, 5.3.3 - 7.3.3
Notice: Array to string conversion in /in/0f1ba on line 4 array(1) { [0]=> &array(1) { [0]=> *RECURSION* } }
Output for 5.2.7 - 5.2.13, 5.3.0 - 5.3.2
Notice: Array to string conversion in /in/0f1ba on line 4 array(1) { [0]=> &array(1) { [0]=> &array(1) { [0]=> *RECURSION* } } }
Output for 5.1.0 - 5.2.6
Notice: Array to string conversion in /in/0f1ba on line 4 string(5) "Array"
Output for 4.3.0 - 5.0.5
Notice: Array to string conversion in /in/0f1ba on line 4 array(1) { [0]=> array(1) { [0]=> *RECURSION* } }