3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pivot = []; $n = 0; for ($i = 1; $i <= 20; $i++) { $pivot[$i] = []; } for($i = 1; $i <= 20; $n++) { $user = &$pivot[$i]; $rand = rand(0, 20); while(array_key_exists($rand, $user) || $rand == $i) { $rand++; } $user[] = $random; if($n == 10) { $i++; $n = 0; } } foreach($pivot as $key => $piv) { echo "INSERT INTO `following_pivot` (`uid`, `fid`) VALUES "; foreach($piv as $pi) { echo "(", $key, ",", $pi, ")"; if($pi !== end($piv)) { echo ","; } } echo ";"; } //print_r($pivot);
based on ZcU5F
Output for 5.4.0 - 7.1.0
Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 Notice: Undefined variable: random in /in/NTaTu on line 19 INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (1,)(1,)(1,)(1,)(1,)(1,)(1,)(1,)(1,)(1,)(1,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (2,)(2,)(2,)(2,)(2,)(2,)(2,)(2,)(2,)(2,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (3,)(3,)(3,)(3,)(3,)(3,)(3,)(3,)(3,)(3,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (4,)(4,)(4,)(4,)(4,)(4,)(4,)(4,)(4,)(4,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (5,)(5,)(5,)(5,)(5,)(5,)(5,)(5,)(5,)(5,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (6,)(6,)(6,)(6,)(6,)(6,)(6,)(6,)(6,)(6,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (7,)(7,)(7,)(7,)(7,)(7,)(7,)(7,)(7,)(7,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (8,)(8,)(8,)(8,)(8,)(8,)(8,)(8,)(8,)(8,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (9,)(9,)(9,)(9,)(9,)(9,)(9,)(9,)(9,)(9,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (10,)(10,)(10,)(10,)(10,)(10,)(10,)(10,)(10,)(10,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (11,)(11,)(11,)(11,)(11,)(11,)(11,)(11,)(11,)(11,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (12,)(12,)(12,)(12,)(12,)(12,)(12,)(12,)(12,)(12,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (13,)(13,)(13,)(13,)(13,)(13,)(13,)(13,)(13,)(13,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (14,)(14,)(14,)(14,)(14,)(14,)(14,)(14,)(14,)(14,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (15,)(15,)(15,)(15,)(15,)(15,)(15,)(15,)(15,)(15,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (16,)(16,)(16,)(16,)(16,)(16,)(16,)(16,)(16,)(16,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (17,)(17,)(17,)(17,)(17,)(17,)(17,)(17,)(17,)(17,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (18,)(18,)(18,)(18,)(18,)(18,)(18,)(18,)(18,)(18,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (19,)(19,)(19,)(19,)(19,)(19,)(19,)(19,)(19,)(19,);INSERT INTO `following_pivot` (`uid`, `fid`) VALUES (20,)(20,)(20,)(20,)(20,)(20,)(20,)(20,)(20,)(20,);
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/NTaTu on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/NTaTu on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/NTaTu on line 4
Process exited with code 255.