3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $gagne = 0; $perdu = 0; for ($i=0;$i<=1000;$i++) { $lancer1 = rand(1,2); $lancer2 = rand(1,2); if($lancer1 == 1 or $lancer2 == 1) { if($lancer2==1 && $lancer1 ==1) { $gagne++; } else { $perdu++; } } } echo $gagne." "; echo $perdu; echo " Proba=".($gagne/($gagne+$perdu)); ?>
Output for 7.1.0
255 496 Proba=0.33954727030626
Output for 7.0.14
230 519 Proba=0.30707610146862
Output for 7.0.10
252 502 Proba=0.3342175066313
Output for 7.0.9
242 513 Proba=0.3205298013245
Output for 7.0.8
227 522 Proba=0.30307076101469
Output for 7.0.7
230 512 Proba=0.3099730458221
Output for 7.0.6
265 511 Proba=0.34149484536082
Output for 7.0.5
239 509 Proba=0.31951871657754
Output for 7.0.4
236 488 Proba=0.32596685082873
Output for 7.0.3
229 540 Proba=0.29778933680104
Output for 7.0.2
221 542 Proba=0.28964613368283
Output for 7.0.1
242 535 Proba=0.31145431145431
Output for 7.0.0
260 502 Proba=0.34120734908136
Output for 5.6.28
232 508 Proba=0.31351351351351
Output for 5.6.25
247 505 Proba=0.32845744680851
Output for 5.6.24
243 484 Proba=0.33425034387895
Output for 5.6.23
252 499 Proba=0.33555259653795
Output for 5.6.22
233 507 Proba=0.31486486486486
Output for 5.6.21
255 490 Proba=0.34228187919463
Output for 5.6.20
229 516 Proba=0.30738255033557
Output for 5.6.19
229 522 Proba=0.30492676431425
Output for 5.6.18
251 514 Proba=0.3281045751634
Output for 5.6.17
223 541 Proba=0.29188481675393
Output for 5.6.16
268 493 Proba=0.35216819973719
Output for 5.6.15
237 499 Proba=0.32201086956522
Output for 5.6.14
246 503 Proba=0.32843791722296
Output for 5.6.13
247 518 Proba=0.32287581699346
Output for 5.6.12
252 498 Proba=0.336
Output for 5.6.11
247 521 Proba=0.32161458333333
Output for 5.6.10
249 508 Proba=0.32892998678996
Output for 5.6.9
259 476 Proba=0.35238095238095
Output for 5.6.8
225 511 Proba=0.30570652173913
Output for 5.6.7
233 528 Proba=0.30617608409987
Output for 5.6.6
274 484 Proba=0.36147757255937
Output for 5.6.5
270 468 Proba=0.36585365853659
Output for 5.6.4
255 508 Proba=0.33420707732634
Output for 5.6.3
255 504 Proba=0.33596837944664
Output for 5.3.5, 5.6.2
253 500 Proba=0.33598937583001
Output for 5.6.1
251 540 Proba=0.3173198482933
Output for 5.6.0
255 510 Proba=0.33333333333333
Output for 5.5.38
256 480 Proba=0.34782608695652
Output for 5.5.37
242 505 Proba=0.3239625167336
Output for 5.5.36
235 508 Proba=0.31628532974428
Output for 5.5.35
261 509 Proba=0.33896103896104
Output for 5.5.34
240 509 Proba=0.32042723631509
Output for 5.5.33
247 501 Proba=0.33021390374332
Output for 5.5.32
254 495 Proba=0.33911882510013
Output for 5.5.31
266 483 Proba=0.35514018691589
Output for 5.5.30
254 481 Proba=0.34557823129252
Output for 5.5.29
238 495 Proba=0.32469304229195
Output for 5.5.28
258 484 Proba=0.34770889487871
Output for 5.5.27
245 503 Proba=0.32754010695187
Output for 5.5.26
256 505 Proba=0.33639947437582
Output for 5.5.25
234 504 Proba=0.31707317073171
Output for 5.5.24
237 506 Proba=0.31897711978466
Output for 5.5.23
262 483 Proba=0.35167785234899
Output for 5.5.22
277 466 Proba=0.37281292059219
Output for 5.5.21
257 514 Proba=0.33333333333333
Output for 5.5.20
229 510 Proba=0.30987821380244
Output for 5.5.19
273 489 Proba=0.35826771653543
Output for 5.5.18
245 501 Proba=0.328418230563
Output for 5.5.16
244 507 Proba=0.32490013315579
Output for 5.5.15
266 485 Proba=0.35419440745672
Output for 5.5.14
236 499 Proba=0.32108843537415
Output for 5.5.13
238 510 Proba=0.31818181818182
Output for 5.5.12
224 514 Proba=0.30352303523035
Output for 5.5.11
262 467 Proba=0.35939643347051
Output for 5.5.10
243 536 Proba=0.31193838254172
Output for 5.5.9
239 525 Proba=0.31282722513089
Output for 5.5.8
235 505 Proba=0.31756756756757
Output for 5.5.7
264 482 Proba=0.35388739946381
Output for 5.5.6
223 520 Proba=0.30013458950202
Output for 5.5.5
245 494 Proba=0.33152909336942
Output for 5.5.4
247 491 Proba=0.33468834688347
Output for 5.5.3
271 496 Proba=0.35332464146023
Output for 5.5.1 - 5.5.2
245 519 Proba=0.32068062827225
Output for 4.4.2, 5.5.0
257 486 Proba=0.34589502018843
Output for 5.4.45
240 497 Proba=0.32564450474898
Output for 5.4.44
260 492 Proba=0.34574468085106
Output for 5.4.43
241 519 Proba=0.31710526315789
Output for 5.4.42
236 508 Proba=0.31720430107527
Output for 5.4.41
252 503 Proba=0.33377483443709
Output for 5.4.40
247 506 Proba=0.32802124833997
Output for 5.4.39
247 493 Proba=0.33378378378378
Output for 5.4.38
248 504 Proba=0.32978723404255
Output for 5.4.37
271 497 Proba=0.35286458333333
Output for 5.4.36
233 522 Proba=0.30860927152318
Output for 5.4.35
241 516 Proba=0.31836195508587
Output for 5.4.34
255 493 Proba=0.34090909090909
Output for 5.4.32
286 494 Proba=0.36666666666667
Output for 5.4.31
242 521 Proba=0.31716906946265
Output for 5.4.30
275 495 Proba=0.35714285714286
Output for 5.4.29
234 530 Proba=0.30628272251309
Output for 5.4.28
249 527 Proba=0.32087628865979
Output for 5.4.27
252 501 Proba=0.33466135458167
Output for 5.4.26
271 499 Proba=0.35194805194805
Output for 5.4.25
269 515 Proba=0.34311224489796
Output for 5.4.24
252 507 Proba=0.33201581027668
Output for 5.4.23
251 490 Proba=0.3387314439946
Output for 5.4.22
249 522 Proba=0.32295719844358
Output for 5.4.21
246 520 Proba=0.32114882506527
Output for 5.4.20
251 516 Proba=0.32724902216428
Output for 5.4.19
253 501 Proba=0.33554376657825
Output for 5.4.18
246 514 Proba=0.32368421052632
Output for 5.4.17
269 493 Proba=0.35301837270341
Output for 5.4.16
258 499 Proba=0.34081902245707
Output for 5.4.15
257 507 Proba=0.33638743455497
Output for 5.4.14
245 507 Proba=0.32579787234043
Output for 5.4.13
233 501 Proba=0.31743869209809
Output for 5.3.22, 5.4.12
253 521 Proba=0.32687338501292
Output for 5.4.11
266 490 Proba=0.35185185185185
Output for 5.4.10
264 484 Proba=0.35294117647059
Output for 5.4.9
257 493 Proba=0.34266666666667
Output for 5.4.8
247 512 Proba=0.32542819499341
Output for 5.4.7
229 517 Proba=0.30697050938338
Output for 5.4.6
241 497 Proba=0.32655826558266
Output for 5.4.5
242 508 Proba=0.32266666666667
Output for 5.4.4
228 526 Proba=0.30238726790451
Output for 5.4.3
251 505 Proba=0.33201058201058
Output for 5.4.2
260 512 Proba=0.33678756476684
Output for 5.4.1
246 509 Proba=0.32582781456954
Output for 5.4.0
248 511 Proba=0.32674571805007
Output for 5.3.29
248 512 Proba=0.32631578947368
Output for 5.3.28
236 504 Proba=0.31891891891892
Output for 5.3.27
249 487 Proba=0.3383152173913
Output for 5.3.26
254 490 Proba=0.34139784946237
Output for 5.3.25
234 520 Proba=0.31034482758621
Output for 5.3.24
260 493 Proba=0.34528552456839
Output for 5.3.23
246 499 Proba=0.33020134228188
Output for 5.3.21
256 504 Proba=0.33684210526316
Output for 5.3.20
243 509 Proba=0.32313829787234
Output for 5.3.19
256 474 Proba=0.35068493150685
Output for 5.3.18
264 487 Proba=0.35153129161119
Output for 5.3.17
273 484 Proba=0.36063408190225
Output for 5.3.16
246 508 Proba=0.3262599469496
Output for 5.3.15
240 510 Proba=0.32
Output for 5.3.14
257 490 Proba=0.34404283801874
Output for 5.3.13
245 468 Proba=0.34361851332398
Output for 5.3.12
239 513 Proba=0.31781914893617
Output for 5.3.11
255 487 Proba=0.34366576819407
Output for 5.3.10
254 489 Proba=0.34185733512786
Output for 5.3.9
236 511 Proba=0.31593038821954
Output for 5.3.8
245 496 Proba=0.3306342780027
Output for 5.3.7
261 480 Proba=0.35222672064777
Output for 5.3.6
257 496 Proba=0.34130146082337
Output for 5.3.4
247 511 Proba=0.32585751978892
Output for 5.3.3
267 494 Proba=0.35085413929041
Output for 5.3.2
263 487 Proba=0.35066666666667
Output for 5.3.1
250 504 Proba=0.3315649867374
Output for 5.3.0
240 514 Proba=0.3183023872679
Output for 5.2.17
241 486 Proba=0.33149931224209
Output for 5.2.16
227 526 Proba=0.30146082337317
Output for 5.2.15
253 487 Proba=0.34189189189189
Output for 5.2.14
220 531 Proba=0.29294274300932
Output for 5.2.13
263 486 Proba=0.35113484646195
Output for 5.2.12
243 505 Proba=0.32486631016043
Output for 5.2.11
273 476 Proba=0.36448598130841
Output for 5.2.10
245 502 Proba=0.32797858099063
Output for 5.2.9
236 516 Proba=0.31382978723404
Output for 5.2.8
251 508 Proba=0.33069828722003
Output for 5.2.7
260 509 Proba=0.33810143042913
Output for 5.2.6
225 498 Proba=0.31120331950207
Output for 5.2.5
240 502 Proba=0.32345013477089
Output for 5.2.4
226 496 Proba=0.31301939058172
Output for 5.2.3
225 512 Proba=0.30529172320217
Output for 5.2.2
261 468 Proba=0.35802469135802
Output for 5.2.1
237 482 Proba=0.32962447844228
Output for 5.2.0
248 495 Proba=0.33378196500673
Output for 5.1.6
249 498 Proba=0.33333333333333
Output for 5.1.5
250 497 Proba=0.33467202141901
Output for 5.1.4
233 506 Proba=0.31529093369418
Output for 5.1.3
248 509 Proba=0.32760898282695
Output for 5.1.2
225 504 Proba=0.30864197530864
Output for 5.1.1
262 510 Proba=0.33937823834197
Output for 5.1.0
265 526 Proba=0.33501896333755
Output for 5.0.5
256 499 Proba=0.33907284768212
Output for 5.0.4
265 501 Proba=0.34595300261097
Output for 5.0.3
246 528 Proba=0.31782945736434
Output for 5.0.2
257 510 Proba=0.33507170795306
Output for 5.0.1
232 529 Proba=0.30486202365309
Output for 5.0.0
242 518 Proba=0.31842105263158
Output for 4.4.9
260 510 Proba=0.33766233766234
Output for 4.4.8
240 512 Proba=0.31914893617021
Output for 4.4.7
234 484 Proba=0.32590529247911
Output for 4.4.6
263 511 Proba=0.33979328165375
Output for 4.4.5
262 525 Proba=0.33290978398983
Output for 4.4.4
231 514 Proba=0.31006711409396
Output for 4.4.3
244 513 Proba=0.3223249669749
Output for 4.4.1
271 492 Proba=0.35517693315858
Output for 4.4.0
249 485 Proba=0.33923705722071
Output for 4.3.11
255 511 Proba=0.33289817232376
Output for 4.3.10
248 494 Proba=0.33423180592992
Output for 4.3.9
238 506 Proba=0.31989247311828
Output for 4.3.8
244 536 Proba=0.31282051282051
Output for 4.3.7
246 518 Proba=0.32198952879581
Output for 4.3.6
271 471 Proba=0.36522911051213
Output for 4.3.5
249 517 Proba=0.32506527415144
Output for 4.3.4
244 477 Proba=0.33841886269071
Output for 4.3.3
239 529 Proba=0.31119791666667
Output for 4.3.2
240 518 Proba=0.31662269129288
Output for 4.3.1
253 507 Proba=0.33289473684211
Output for 4.3.0
236 514 Proba=0.31466666666667