1--TEST-- 2json_encode() & endless loop - 3 3--FILE-- 4<?php 5 6$a = array(); 7$a[] = $a; 8 9var_dump($a); 10var_dump(json_encode($a)); 11 12echo "Done\n"; 13?> 14--EXPECT-- 15array(1) { 16 [0]=> 17 array(0) { 18 } 19} 20string(4) "[[]]" 21Done 22