3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getBaconSentences($len) { $paragraph = ""; $words = array( "upper" => array("The", "A", "One", "Some", "Any"), "lower" => array("the", "a", "one", "some", "any"), "noun" => array("boy", "girl", "dog", "town", "car"), "verb" => array("drove", "jumped", "ran", "walked", "skipped"), "prep" => array("to", "from", "over", "under", "on"), "adj" => array('tiny', 'freezing', 'lazy','boiling','filthy') ); $structures = array( array('upper', 'noun', 'verb', 'prep', 'lower', 'noun'), array('upper', 'noun', 'verb', 'prep', 'lower', 'adj', 'noun') ); while($len--) { $sentence = array(); $randStructure = array_rand($structures); for($i=0; $i<count($structures[$randStructure]); $i++) { echo json_encode($randStructure); $word = ' ';//array_rand($words[$randStructure[$i]]); $sentence[] = $word ; } $paragraph .= implode(" ", $sentence) . '. '; } return $paragraph; } echo getBaconSentences(10);
Output for 5.3.6, 7.1.0
0000000000001111111000000000000000000000000111111111111111111111 . . . . . . . . . .
Output for 7.0.14
000000111111111111110000001111111000000000000111111111111111111111 . . . . . . . . . .
Output for 7.0.12
111111111111110000000000001111111000000111111111111111111111000000 . . . . . . . . . .
Output for 7.0.11
0000001111111111111100000011111111111111000000111111111111111111111 . . . . . . . . . .
Output for 7.0.10
000000111111100000011111110000001111111000000111111111111111111111 . . . . . . . . . .
Output for 7.0.9
11111110000000000001111111000000111111111111110000001111111000000 . . . . . . . . . .
Output for 5.5.21, 5.5.37, 7.0.8
0000000000001111111000000000000000000111111100000011111111111111 . . . . . . . . . .
Output for 5.4.22, 7.0.7
11111111111111111111100000011111111111111000000000000000000000000 . . . . . . . . . .
Output for 7.0.6
1111111000000000000111111111111110000000000001111111000000000000 . . . . . . . . . .
Output for 7.0.5
1111111000000000000111111111111110000000000000000001111111000000 . . . . . . . . . .
Output for 7.0.4
111111111111111111111000000111111100000000000000000011111111111111 . . . . . . . . . .
Output for 7.0.3
000000000000111111100000000000011111111111111111111111111111111111 . . . . . . . . . .
Output for 7.0.2
0000001111111111111111111111111111000000000000111111111111111111111 . . . . . . . . . .
Output for 7.0.1
1111111000000000000111111100000000000000000011111111111111000000 . . . . . . . . . .
Output for 7.0.0
000000000000000000000000111111100000011111111111111000000000000 . . . . . . . . . .
Output for 5.6.28
1111111111111111111111111111111111111111110000001111111000000000000 . . . . . . . . . .
Output for 5.6.26
00000000000011111110000000000000000001111111111111111111111111111 . . . . . . . . . .
Output for 5.2.6, 5.6.25
00000011111110000001111111000000111111111111110000000000001111111 . . . . . . . . . .
Output for 5.3.24, 5.6.24
00000000000011111111111111000000111111100000011111111111111000000 . . . . . . . . . .
Output for 5.6.23
11111110000000000001111111000000111111111111111111111000000000000 . . . . . . . . . .
Output for 5.6.22
111111100000000000011111111111111111111100000011111110000001111111 . . . . . . . . . .
Output for 5.6.21
111111111111110000001111111000000000000111111100000011111111111111 . . . . . . . . . .
Output for 5.6.20
000000111111100000000000011111111111111000000000000000000000000 . . . . . . . . . .
Output for 5.6.19
00000000000011111111111111111111100000011111110000001111111000000 . . . . . . . . . .
Output for 5.6.18
00000000000011111110000001111111111111100000000000011111111111111 . . . . . . . . . .
Output for 5.6.17
00000011111111111111111111100000011111111111111111111111111111111111 . . . . . . . . . .
Output for 5.6.16
000000111111100000011111111111111111111111111110000001111111000000 . . . . . . . . . .
Output for 5.6.15
11111111111111111111100000011111111111111111111111111111111111000000 . . . . . . . . . .
Output for 5.6.14
111111100000000000000000000000000000011111111111111000000000000 . . . . . . . . . .
Output for 5.6.13
1111111000000111111100000000000011111110000001111111000000000000 . . . . . . . . . .
Output for 5.6.12
0000000000001111111111111100000000000011111110000001111111000000 . . . . . . . . . .
Output for 5.6.11
1111111111111111111111111111111111100000011111110000000000001111111 . . . . . . . . . .
Output for 5.6.10
00000000000011111110000000000001111111000000000000000000000000 . . . . . . . . . .
Output for 5.6.9
0000000000001111111000000000000000000111111111111111111111000000 . . . . . . . . . .
Output for 5.6.8
0000001111111000000000000000000111111100000000000011111111111111 . . . . . . . . . .
Output for 5.6.7
0000000000000000000000001111111000000111111100000011111111111111 . . . . . . . . . .
Output for 5.6.6
000000111111111111110000001111111111111111111110000001111111000000 . . . . . . . . . .
Output for 5.6.5
000000000000111111111111110000000000001111111000000000000000000 . . . . . . . . . .
Output for 5.6.4
1111111000000000000000000000000111111100000011111110000001111111 . . . . . . . . . .
Output for 5.4.4, 5.6.3
00000000000000000011111111111111111111111111110000001111111000000 . . . . . . . . . .
Output for 5.6.2
000000000000111111100000000000000000000000000000011111111111111 . . . . . . . . . .
Output for 5.6.1
0000001111111111111100000011111110000001111111111111111111111111111 . . . . . . . . . .
Output for 5.6.0
1111111111111100000000000000000011111110000001111111000000000000 . . . . . . . . . .
Output for 5.5.38
1111111111111111111110000000000000000000000000000001111111000000 . . . . . . . . . .
Output for 5.5.36
11111111111111111111100000000000000000011111110000000000001111111 . . . . . . . . . .
Output for 5.5.35
0000001111111000000111111100000000000011111110000000000001111111 . . . . . . . . . .
Output for 5.4.32, 5.5.34
000000111111111111111111111111111100000011111110000001111111000000 . . . . . . . . . .
Output for 5.5.33
00000011111111111111000000111111100000000000000000011111111111111 . . . . . . . . . .
Output for 5.5.32
111111111111110000000000001111111111111100000011111110000001111111 . . . . . . . . . .
Output for 5.5.31
0000001111111000000111111111111110000000000000000001111111000000 . . . . . . . . . .
Output for 5.5.30
11111111111111111111100000011111111111111111111111111110000001111111 . . . . . . . . . .
Output for 5.5.29
111111100000011111111111111000000111111111111110000000000001111111 . . . . . . . . . .
Output for 5.5.28
000000000000000000111111111111111111111111111111111110000001111111 . . . . . . . . . .
Output for 5.5.27
11111111111111111111100000011111110000001111111000000000000000000 . . . . . . . . . .
Output for 5.5.26
0000001111111000000111111100000000000000000011111111111111000000 . . . . . . . . . .
Output for 5.5.25
1111111111111100000000000011111111111111111111111111111111111000000 . . . . . . . . . .
Output for 5.5.24
00000000000011111110000001111111000000111111100000011111111111111 . . . . . . . . . .
Output for 5.5.23
00000000000000000011111111111111111111100000011111110000001111111 . . . . . . . . . .
Output for 5.5.22
0000000000001111111111111111111111111111000000111111111111111111111 . . . . . . . . . .
Output for 5.5.20
11111110000001111111000000000000000000111111100000011111111111111 . . . . . . . . . .
Output for 5.5.19
000000000000111111100000011111110000000000001111111000000000000 . . . . . . . . . .
Output for 5.5.10, 5.5.18
1111111000000111111111111111111111000000000000000000000000000000 . . . . . . . . . .
Output for 5.5.16
000000111111111111111111111000000000000111111111111110000001111111 . . . . . . . . . .
Output for 5.4.19, 5.5.15
0000001111111111111111111110000001111111111111100000011111111111111 . . . . . . . . . .
Output for 5.5.14
1111111111111100000011111111111111111111100000011111111111111000000 . . . . . . . . . .
Output for 5.5.13
0000001111111111111111111111111111111111111111110000000000001111111 . . . . . . . . . .
Output for 5.5.12
111111100000011111111111111111111100000000000000000011111111111111 . . . . . . . . . .
Output for 5.5.11
1111111111111111111111111111000000000000000000000000000000000000 . . . . . . . . . .
Output for 5.5.9
1111111000000000000000000000000000000000000000000000000000000 . . . . . . . . . .
Output for 5.5.8
00000011111110000000000000000001111111000000000000000000000000 . . . . . . . . . .
Output for 5.5.7
11111111111111000000000000000000000000111111111111111111111000000 . . . . . . . . . .
Output for 5.5.6
1111111000000111111111111110000001111111111111111111110000001111111 . . . . . . . . . .
Output for 5.5.5
00000000000011111111111111000000000000000000000000000000000000 . . . . . . . . . .
Output for 5.5.4
0000001111111111111111111111111111000000111111111111111111111000000 . . . . . . . . . .
Output for 5.5.3
1111111000000111111111111110000001111111000000000000000000000000 . . . . . . . . . .
Output for 5.5.2
11111110000000000001111111000000111111100000011111111111111000000 . . . . . . . . . .
Output for 5.5.1
11111110000001111111000000000000111111111111111111111000000000000 . . . . . . . . . .
Output for 5.5.0
11111110000000000001111111111111100000011111110000001111111000000 . . . . . . . . . .
Output for 5.4.45
11111110000000000001111111000000000000000000000000000000000000 . . . . . . . . . .
Output for 5.4.44
0000000000000000000000001111111111111111111110000000000001111111 . . . . . . . . . .
Output for 5.4.43
11111111111111000000111111111111110000001111111000000000000000000 . . . . . . . . . .
Output for 5.4.42
00000011111110000001111111000000000000111111111111111111111000000 . . . . . . . . . .
Output for 5.4.41
0000000000001111111000000000000000000000000000000000000000000 . . . . . . . . . .
Output for 5.4.40
0000000000000000001111111111111100000000000011111110000001111111 . . . . . . . . . .
Output for 5.4.39
11111111111111000000111111100000000000011111111111111000000000000 . . . . . . . . . .
Output for 5.4.38
000000111111111111111111111000000111111100000011111111111111000000 . . . . . . . . . .
Output for 5.4.37
1111111111111100000000000000000011111111111111000000000000000000 . . . . . . . . . .
Output for 5.4.36
000000000000000000111111100000000000011111110000001111111000000 . . . . . . . . . .
Output for 5.4.35
111111111111111111111000000111111111111110000001111111000000000000 . . . . . . . . . .
Output for 5.4.34
111111111111110000000000001111111111111111111110000000000001111111 . . . . . . . . . .
Output for 5.4.31
000000000000000000000000111111111111110000000000001111111000000 . . . . . . . . . .
Output for 5.4.30
111111100000011111110000000000000000000000000000000000001111111 . . . . . . . . . .
Output for 5.4.29
11111110000001111111000000000000111111100000000000011111111111111 . . . . . . . . . .
Output for 5.4.28
000000111111100000000000000000011111110000001111111000000000000 . . . . . . . . . .
Output for 5.4.27
00000000000011111110000001111111111111111111111111111000000000000 . . . . . . . . . .
Output for 5.4.26
1111111111111100000000000000000011111111111111111111111111111111111 . . . . . . . . . .
Output for 5.4.25
0000000000001111111000000111111100000000000011111110000001111111 . . . . . . . . . .
Output for 5.4.24
11111111111111111111111111110000001111111111111111111110000001111111 . . . . . . . . . .
Output for 5.4.23
11111110000001111111000000000000111111100000011111110000001111111 . . . . . . . . . .
Output for 5.4.21
0000001111111000000111111100000011111111111111111111111111111111111 . . . . . . . . . .
Output for 5.4.20
11111110000000000000000001111111111111111111111111111000000000000 . . . . . . . . . .
Output for 5.4.18
000000000000111111111111111111111111111100000000000011111111111111 . . . . . . . . . .
Output for 5.4.17
0000000000001111111000000000000111111100000011111110000001111111 . . . . . . . . . .
Output for 5.4.16
1111111111111100000000000011111111111111000000000000000000000000 . . . . . . . . . .
Output for 5.4.15
111111111111111111111000000000000111111111111111111111000000000000 . . . . . . . . . .
Output for 5.4.14
111111111111110000001111111000000111111100000000000011111111111111 . . . . . . . . . .
Output for 5.4.13
0000000000000000001111111111111100000000000000000011111111111111 . . . . . . . . . .
Output for 5.4.12
11111111111111000000111111111111110000000000000000000000001111111 . . . . . . . . . .
Output for 5.4.11
000000000000000000111111111111110000001111111000000000000000000 . . . . . . . . . .
Output for 5.4.10
000000000000111111111111111111111111111111111110000000000001111111 . . . . . . . . . .
Output for 5.4.9
0000001111111000000111111100000011111111111111000000000000000000 . . . . . . . . . .
Output for 5.4.8
0000001111111000000111111111111110000001111111000000000000000000 . . . . . . . . . .
Output for 5.4.7
00000000000000000000000000000000000000000011111110000001111111 . . . . . . . . . .
Output for 5.4.6
111111111111110000000000000000000000000000001111111000000000000 . . . . . . . . . .
Output for 5.4.5
000000000000000000111111100000011111111111111111111111111111111111 . . . . . . . . . .
Output for 5.4.3
0000001111111111111100000000000011111110000000000001111111000000 . . . . . . . . . .
Output for 5.4.2
111111100000011111111111111111111100000011111110000000000001111111 . . . . . . . . . .
Output for 5.4.1
1111111000000111111111111110000000000001111111111111111111111111111 . . . . . . . . . .
Output for 5.4.0
0000000000000000000000001111111000000000000111111111111111111111 . . . . . . . . . .
Output for 5.3.29
000000111111111111110000000000000000001111111111111111111111111111 . . . . . . . . . .
Output for 5.3.28
000000000000111111111111110000000000001111111111111111111111111111 . . . . . . . . . .
Output for 5.3.27
1111111000000000000000000111111100000011111111111111000000000000 . . . . . . . . . .
Output for 5.3.26
0000001111111111111100000011111111111111111111111111111111111000000 . . . . . . . . . .
Output for 5.3.25
11111110000001111111000000111111111111111111111111111111111111111111 . . . . . . . . . .
Output for 5.3.23
000000111111100000011111111111111111111111111110000000000001111111 . . . . . . . . . .
Output for 5.3.22
000000000000000000000000000000000000000000111111111111111111111 . . . . . . . . . .
Output for 5.3.21
1111111000000000000000000111111111111110000000000001111111000000 . . . . . . . . . .
Output for 5.3.20
00000011111111111111000000000000000000111111100000011111111111111 . . . . . . . . . .
Output for 5.3.19
111111100000011111111111111111111111111111111111000000000000000000 . . . . . . . . . .
Output for 5.3.18
1111111111111100000011111110000000000000000000000000000001111111 . . . . . . . . . .
Output for 5.3.17
0000000000000000000000001111111111111100000011111111111111000000 . . . . . . . . . .
Output for 5.3.16
000000111111100000000000011111110000000000001111111000000000000 . . . . . . . . . .
Output for 5.3.15
111111111111110000001111111000000111111100000011111111111111000000 . . . . . . . . . .
Output for 5.3.14
000000111111111111110000000000001111111111111111111111111111000000 . . . . . . . . . .
Output for 5.3.13
000000000000111111111111111111111000000111111111111110000001111111 . . . . . . . . . .
Output for 5.3.12
111111100000000000000000000000011111110000001111111000000000000 . . . . . . . . . .
Output for 5.3.11
000000111111111111111111111000000111111111111111111111000000000000 . . . . . . . . . .
Output for 5.3.10
11111111111111000000111111111111111111111111111100000011111111111111 . . . . . . . . . .
Output for 5.3.9
00000011111110000001111111000000000000111111100000011111111111111 . . . . . . . . . .
Output for 5.3.8
0000000000001111111000000111111100000011111110000000000001111111 . . . . . . . . . .
Output for 5.3.7
00000000000011111110000000000000000000000001111111000000000000 . . . . . . . . . .
Output for 5.3.5
0000000000001111111111111100000011111110000000000000000001111111 . . . . . . . . . .
Output for 5.3.4
000000000000111111111111111111111111111100000011111110000001111111 . . . . . . . . . .
Output for 5.3.3
111111100000000000000000000000000000000000011111110000001111111 . . . . . . . . . .
Output for 5.3.2
111111100000000000011111111111111111111111111110000001111111000000 . . . . . . . . . .
Output for 5.3.1
000000111111100000000000011111110000001111111111111111111111111111 . . . . . . . . . .
Output for 5.3.0
000000111111111111111111111000000111111111111110000001111111000000 . . . . . . . . . .
Output for 5.2.17
111111111111110000000000000000001111111000000000000000000000000 . . . . . . . . . .
Output for 5.2.16
00000000000000000000000000000011111110000001111111000000000000 . . . . . . . . . .
Output for 5.2.15
00000011111111111111111111111111110000000000001111111000000000000 . . . . . . . . . .
Output for 5.2.14
000000111111111111110000000000001111111000000000000000000000000 . . . . . . . . . .
Output for 5.2.13
111111100000000000011111110000000000001111111000000000000000000 . . . . . . . . . .
Output for 5.2.12
000000111111111111110000000000001111111000000111111111111111111111 . . . . . . . . . .
Output for 5.2.11
111111111111110000001111111000000000000111111111111110000001111111 . . . . . . . . . .
Output for 5.2.10
1111111000000000000111111100000011111110000000000001111111000000 . . . . . . . . . .
Output for 5.2.9
11111111111111000000111111100000000000000000011111110000001111111 . . . . . . . . . .
Output for 5.2.8
000000000000111111100000000000000000011111111111111000000000000 . . . . . . . . . .
Output for 5.2.7
000000111111100000000000000000000000000000011111111111111000000 . . . . . . . . . .
Output for 5.2.5
11111110000001111111111111100000000000000000000000011111111111111 . . . . . . . . . .
Output for 5.2.4
11111111111111000000111111111111110000000000001111111000000000000 . . . . . . . . . .
Output for 5.2.3
0000001111111111111100000000000000000011111110000000000001111111 . . . . . . . . . .
Output for 5.2.2
000000000000000000000000111111100000000000011111111111111000000 . . . . . . . . . .
Output for 5.2.1
11111111111111111111100000011111110000000000000000000000001111111 . . . . . . . . . .
Output for 5.2.0
000000000000111111100000011111110000000000000000001111111000000 . . . . . . . . . .
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/g3BHe on line 27
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/g3BHe on line 27
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/g3BHe on line 27
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/g3BHe on line 27