3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $gagne = 0; $perdu = 0; for ($i=0;$i<=10000;$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
2462 5015 Proba=0.32927644777317
Output for 7.0.14
2503 4969 Proba=0.33498394004283
Output for 7.0.6
2553 4913 Proba=0.34195017412269
Output for 7.0.5
2576 4961 Proba=0.34178054929017
Output for 7.0.4
2512 4942 Proba=0.33700026831232
Output for 7.0.3
2462 5038 Proba=0.32826666666667
Output for 7.0.2
2547 5043 Proba=0.33557312252964
Output for 7.0.1
2486 5037 Proba=0.33045327661837
Output for 7.0.0
2491 5034 Proba=0.33102990033223
Output for hhvm-3.12.0
2472 5001 Proba=0.33079084704938
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
2543 4988 Proba=0.33767096003187
Output for 5.6.21
2458 4990 Proba=0.33002148227712
Output for 5.6.20
2511 4948 Proba=0.33664030030835
Output for 5.6.19
2473 4974 Proba=0.33208003222774
Output for 5.6.18
2509 4984 Proba=0.33484585613239
Output for 5.6.17
2449 5070 Proba=0.32570820587844
Output for 5.6.16
2561 4974 Proba=0.33988055739881
Output for 5.6.15
2522 5014 Proba=0.33466029723992
Output for 5.6.14
2460 5038 Proba=0.32808748999733
Output for 5.6.13
2535 5022 Proba=0.33545057562525
Output for 5.6.12
2529 4867 Proba=0.34194159004867
Output for 5.6.11
2532 4925 Proba=0.33954673461177
Output for 5.6.10
2513 4953 Proba=0.33659255290651
Output for 5.6.9
2527 5021 Proba=0.33479067302597
Output for 5.6.8
2486 4992 Proba=0.33244182936614
Output for 5.5.35
2446 4981 Proba=0.32933889861317
Output for 5.5.34
2447 5118 Proba=0.32346331791143
Output for 5.5.33
2467 5055 Proba=0.32797128423292
Output for 5.5.32
2517 5037 Proba=0.33320095313741
Output for 5.5.31
2431 5046 Proba=0.32513039989301
Output for 5.5.30
2463 4979 Proba=0.33095941951088
Output for 5.5.29
2491 4906 Proba=0.336758145194
Output for 5.5.28
2513 5008 Proba=0.33413109958782
Output for 5.5.27
2571 4900 Proba=0.34413063846875
Output for 5.5.26
2494 5002 Proba=0.33271077908218
Output for 5.5.25
2419 4998 Proba=0.32614264527437
Output for 5.5.24
2463 5064 Proba=0.32722200079713
Output for 5.4.45
2561 4934 Proba=0.34169446297532
Output for 5.4.44
2463 5030 Proba=0.32870679300681
Output for 5.4.43
2517 4973 Proba=0.33604806408545
Output for 5.4.42
2486 5031 Proba=0.33071704137289
Output for 5.4.41
2461 5032 Proba=0.32843987721874
Output for 5.4.40
2519 4947 Proba=0.33739619608894
Output for 5.4.39
2541 5052 Proba=0.33465033583564
Output for 5.4.38
2532 4938 Proba=0.33895582329317
Output for 5.4.37
2520 4971 Proba=0.33640368442131
Output for 5.4.36
2408 4964 Proba=0.32664134563212
Output for 5.4.35
2474 4980 Proba=0.33190233431715
Output for 5.4.34
2501 4950 Proba=0.33565964300094
Output for 5.4.32
2500 5010 Proba=0.33288948069241
Output for 5.4.31
2466 5007 Proba=0.32998795664392
Output for 5.4.30
2520 4976 Proba=0.33617929562433
Output for 5.4.29
2450 5024 Proba=0.32780305057533
Output for 5.4.28
2534 4974 Proba=0.33750665956313
Output for 5.4.27
2614 4795 Proba=0.35281414495883
Output for 5.4.26
2529 4991 Proba=0.33630319148936
Output for 5.4.25
2523 4981 Proba=0.33622068230277
Output for 5.4.24
2445 5023 Proba=0.32739689341189
Output for 5.4.23
2440 5019 Proba=0.32712159806945
Output for 5.4.22
2488 5054 Proba=0.32988597189075
Output for 5.4.21
2517 4978 Proba=0.33582388258839
Output for 5.4.20
2430 5019 Proba=0.32621828433347
Output for 5.4.19
2450 5081 Proba=0.32532200239012
Output for 5.4.18
2489 4996 Proba=0.33253173012692
Output for 5.4.17
2519 4943 Proba=0.33757705708925
Output for 5.4.16
2468 4992 Proba=0.33083109919571
Output for 5.4.15
2557 4925 Proba=0.34175354183373
Output for 5.4.14
2534 4950 Proba=0.338588989845
Output for 5.4.13
2431 5032 Proba=0.32574031890661
Output for 5.4.12
2466 4975 Proba=0.33140706894235
Output for 5.4.11
2538 4974 Proba=0.33785942492013
Output for 5.4.10
2535 4968 Proba=0.33786485405838
Output for 5.4.9
2431 5047 Proba=0.3250869216368
Output for 5.4.8
2495 5097 Proba=0.3286354056902
Output for 5.4.7
2620 4925 Proba=0.34724983432737
Output for 5.4.6
2486 4976 Proba=0.33315465022782
Output for 5.4.5
2516 4937 Proba=0.33758218167181
Output for 5.4.4
2472 5041 Proba=0.32902968188473
Output for 5.4.3
2395 5129 Proba=0.31831472620946
Output for 5.4.2
2454 4993 Proba=0.32952866926279
Output for 5.4.1
2412 5028 Proba=0.3241935483871
Output for 5.4.0
2509 5013 Proba=0.33355490561021
Output for 5.3.29
2465 5094 Proba=0.32610133615558
Output for 5.3.28
2483 5012 Proba=0.33128752501668
Output for 5.3.27
2519 5000 Proba=0.33501795451523
Output for 5.3.26
2414 5023 Proba=0.32459324996638
Output for 5.3.25
2502 4898 Proba=0.33810810810811
Output for 5.3.24
2523 4996 Proba=0.33554994015162
Output for 5.3.23
2551 4982 Proba=0.33864330280101
Output for 5.3.22
2468 5116 Proba=0.32542194092827
Output for 5.3.21
2468 4986 Proba=0.33109739737054
Output for 5.3.20
2504 4951 Proba=0.33588195841717
Output for 5.3.19
2508 5000 Proba=0.33404368673415
Output for 5.3.18
2560 4962 Proba=0.34033501728264
Output for 5.3.17
2440 5005 Proba=0.32773673606447
Output for 5.3.16
2489 4979 Proba=0.33328869844671
Output for 5.3.15
2579 4894 Proba=0.34510905928007
Output for 5.3.14
2419 5044 Proba=0.32413238643977
Output for 5.3.13
2416 5038 Proba=0.32412127716662
Output for 5.3.12
2494 4928 Proba=0.33602802479116
Output for 5.3.11
2479 4944 Proba=0.33396200996902
Output for 5.3.10
2472 4992 Proba=0.33118971061093
Output for 5.3.9
2409 5079 Proba=0.32171474358974
Output for 5.3.8
2416 5129 Proba=0.32021206096753
Output for 5.3.7
2569 4982 Proba=0.340219838432
Output for 5.3.6
2489 4917 Proba=0.33607885498245
Output for 5.3.5
2486 5015 Proba=0.33142247700307
Output for 5.3.4
2585 4942 Proba=0.34343031752358
Output for 5.3.3
2544 4981 Proba=0.338073089701
Output for 5.3.2
2422 5020 Proba=0.32545014780973
Output for 5.3.1
2517 5041 Proba=0.3330246096851
Output for 5.3.0
2515 5056 Proba=0.33218861444987
Output for 5.2.17
2486 4997 Proba=0.33221969798209
Output for 5.2.16
2453 4972 Proba=0.33037037037037
Output for 5.2.15
2560 4978 Proba=0.33961262934465
Output for 5.2.14
2504 4948 Proba=0.33601717659689
Output for 5.2.13
2510 4965 Proba=0.33578595317726
Output for 5.2.12
2440 5095 Proba=0.32382216323822
Output for 5.2.11
2525 5048 Proba=0.333421365377
Output for 5.2.10
2515 4963 Proba=0.33631987162343
Output for 5.2.9
2484 5023 Proba=0.33089116824297
Output for 5.2.8
2473 5048 Proba=0.32881265789124
Output for 5.2.7
2501 4983 Proba=0.33417958311064
Output for 5.2.6
2485 4997 Proba=0.3321304464047
Output for 5.2.5
2510 4911 Proba=0.33822934914432
Output for 5.2.4
2531 4954 Proba=0.33814295257181
Output for 5.2.3
2536 4924 Proba=0.33994638069705
Output for 5.2.2
2464 4986 Proba=0.33073825503356
Output for 5.2.1
2500 4996 Proba=0.33351120597652
Output for 5.2.0
2445 5029 Proba=0.32713406475783
Output for 5.1.6
2407 4991 Proba=0.32535820492025
Output for 5.1.5
2491 5018 Proba=0.33173525103209
Output for 5.1.4
2512 4990 Proba=0.33484404158891
Output for 5.1.3
2526 5033 Proba=0.3341711866649
Output for 5.1.2
2495 4992 Proba=0.33324429010284
Output for 5.1.1
2440 5087 Proba=0.32416633452903
Output for 5.1.0
2472 5008 Proba=0.33048128342246
Output for 5.0.5
2485 4995 Proba=0.3322192513369
Output for 5.0.4
2536 5018 Proba=0.33571617685994
Output for 5.0.3
2527 4950 Proba=0.33796977397352
Output for 5.0.2
2486 5030 Proba=0.33076104310804
Output for 5.0.1
2470 5054 Proba=0.32828282828283
Output for 5.0.0
2498 4967 Proba=0.33462826523778
Output for 4.4.9
2547 4940 Proba=0.34018966208094
Output for 4.4.8
2530 4974 Proba=0.33715351812367
Output for 4.4.7
2485 5045 Proba=0.33001328021248
Output for 4.4.6
2486 4980 Proba=0.33297615858559
Output for 4.4.5
2498 5014 Proba=0.3325346112886
Output for 4.4.4
2455 5079 Proba=0.32585611892753
Output for 4.4.3
2548 4970 Proba=0.3389199255121
Output for 4.4.2
2503 5030 Proba=0.3322713394398
Output for 4.4.1
2541 5018 Proba=0.33615557613441
Output for 4.4.0
2453 4997 Proba=0.32926174496644
Output for 4.3.11
2481 4952 Proba=0.3337817839365
Output for 4.3.10
2457 5049 Proba=0.3273381294964
Output for 4.3.9
2573 4957 Proba=0.34169986719788
Output for 4.3.8
2589 4951 Proba=0.34336870026525
Output for 4.3.7
2477 5044 Proba=0.3293445020609
Output for 4.3.6
2477 5041 Proba=0.32947592444799
Output for 4.3.5
2476 5044 Proba=0.32925531914894
Output for 4.3.4
2481 5050 Proba=0.32943832160404
Output for 4.3.3
2530 4981 Proba=0.33683930235654
Output for 4.3.2
2529 4939 Proba=0.33864488484199
Output for 4.3.1
2500 4946 Proba=0.33575073865163
Output for 4.3.0
2492 5017 Proba=0.3318684245572