3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function addRandomToN($n, $m) { $plus = mt_rand(0,1); if ($plus) { return $n + (($n*$m) * rand0To1()); } return $n - (($n*$m) * rand0To1()); } function rand0To1() { return (float)rand()/(float)getrandmax(); } $var = addRandomToN(5, 0.1); echo $var; $var--; echo $var;
Output for 7.1.0
5.26844583487534.2684458348753
Output for 7.0.14
5.28725950666114.2872595066611
Output for 7.0.7
5.29396992376724.2939699237672
Output for 7.0.6
4.87588568212273.8758856821227
Output for 7.0.5
5.33642524217094.3364252421709
Output for 7.0.4
5.19599266429254.1959926642925
Output for 7.0.3
5.42069489598314.4206948959831
Output for 7.0.2
5.14970214788324.1497021478832
Output for 7.0.1
4.99326351494213.9932635149421
Output for 7.0.0
5.38890027831724.3889002783172
Output for hhvm-3.12.0
5.42087604031944.4208760403194
Output for hhvm-3.10.0
5.06043558547294.0604355854729
Output for 5.6.28
5.04635561702144.0463556170214
Output for 5.6.22
5.1457215836954.145721583695
Output for 5.6.21
5.36330191016354.3633019101635
Output for 5.6.20
5.34880250103254.3488025010325
Output for 5.6.19
5.29199184025264.2919918402526
Output for 5.6.18
4.99051517550393.9905151755039
Output for 5.6.17
4.73840708995163.7384070899516
Output for 5.6.16
5.29984598108564.2998459810856
Output for 5.6.15
5.16965624069314.1696562406931
Output for 5.6.14
4.7163676562333.716367656233
Output for 5.6.13
4.62567855353733.6256785535373
Output for 5.6.12
5.12791630724814.1279163072481
Output for 5.6.11
4.75170443847393.7517044384739
Output for 5.6.10
4.90420054546753.9042005454675
Output for 5.6.9
5.01610184647894.0161018464789
Output for 5.6.8
4.51975240047083.5197524004708
Output for 5.6.7
4.96305389793733.9630538979373
Output for 5.6.6
5.21778245210544.2177824521054
Output for 5.6.5
4.84043787202823.8404378720282
Output for 5.6.4
5.29001608225054.2900160822505
Output for 5.6.3
5.42481723750234.4248172375023
Output for 5.6.2
4.58486186786783.5848618678678
Output for 5.6.1
4.74066743196023.7406674319602
Output for 5.6.0
5.48203993401594.4820399340159
Output for 5.5.36
4.89660420217393.8966042021739
Output for 5.5.35
5.30259392191784.3025939219178
Output for 5.5.34
5.3571023796024.357102379602
Output for 5.5.33
4.86898930387993.8689893038799
Output for 5.5.32
4.65512771934983.6551277193498
Output for 5.5.31
5.19152359324114.1915235932411
Output for 5.5.30
4.88757324353213.8875732435321
Output for 5.5.29
4.74429810617323.7442981061732
Output for 5.5.28
4.6496657778743.649665777874
Output for 5.5.27
4.86755225824543.8675522582454
Output for 5.5.26
5.0893821255724.089382125572
Output for 5.5.25
4.56860794549283.5686079454928
Output for 5.5.24
5.20833502440174.2083350244017
Output for 5.5.23
5.47582844550534.4758284455053
Output for 5.5.22
5.06336372045964.0633637204596
Output for 5.5.21
5.03102348094394.0310234809439
Output for 5.5.20
4.64614705818063.6461470581806
Output for 5.5.19
5.01049056835964.0104905683596
Output for 5.5.18
4.97035277703333.9703527770333
Output for 5.5.16
5.30907938504084.3090793850408
Output for 5.5.15
5.33328505504564.3332850550456
Output for 5.5.14
5.27495508048454.2749550804845
Output for 5.5.13
4.68447022497863.6844702249786
Output for 5.5.12
4.70388483405293.7038848340529
Output for 5.5.11
5.03707374587524.0370737458752
Output for 5.5.10
5.29349827710244.2934982771024
Output for 5.5.9
4.67787337823673.6778733782367
Output for 5.5.8
5.3736348924574.373634892457
Output for 5.5.7
5.22424763102284.2242476310228
Output for 5.5.6
5.07508976993854.0750897699385
Output for 5.5.5
5.27629769862464.2762976986246
Output for 5.5.4
5.29211569451364.2921156945136
Output for 5.5.3
4.87260121543553.8726012154355
Output for 5.5.2
4.75888871576593.7588887157659
Output for 5.5.1
4.51130490284943.5113049028494
Output for 5.5.0
4.57768753803233.5776875380323
Output for 5.4.45
5.2856771099784.285677109978
Output for 5.4.44
4.74088130855973.7408813085597
Output for 5.4.43
4.82295514891063.8229551489106
Output for 5.4.42
4.83420330255023.8342033025502
Output for 5.4.41
5.07021736147364.0702173614736
Output for 5.4.40
5.05501036395094.0550103639509
Output for 5.4.39
4.65294326150463.6529432615046
Output for 5.4.38
4.90376887279743.9037688727974
Output for 5.4.37
5.08907866388984.0890786638898
Output for 5.4.36
4.97963873901393.9796387390139
Output for 5.4.35
5.16458640488084.1645864048808
Output for 5.4.34
4.82793239007143.8279323900714
Output for 5.4.32
5.06656686452524.0665668645252
Output for 5.4.31
5.23037429444044.2303742944404
Output for 5.4.30
5.4117490239034.411749023903
Output for 5.4.29
5.36525469825854.3652546982585
Output for 5.4.28
5.3981265641744.398126564174
Output for 5.4.27
4.77696884133713.7769688413371
Output for 5.4.26
5.33090470118024.3309047011802
Output for 5.4.25
4.89735874808273.8973587480827
Output for 5.4.24
4.94737800720493.9473780072049
Output for 5.4.23
5.28533815815364.2853381581536
Output for 5.4.22
4.66442809028763.6644280902876
Output for 5.4.21
4.94767210094623.9476721009462
Output for 5.4.20
5.07123675386944.0712367538694
Output for 5.4.19
5.47766908559844.4776690855984
Output for 5.4.18
5.40427254508454.4042725450845
Output for 5.4.17
4.6092075014533.609207501453
Output for 5.4.16
5.24544646322984.2454464632298
Output for 5.4.15
5.42390712766164.4239071276616
Output for 5.4.14
4.93555604011543.9355560401154
Output for 5.4.13
5.41420994788144.4142099478814
Output for 5.4.12
5.1782178774844.178217877484
Output for 5.4.11
5.34770084211964.3477008421196
Output for 5.4.10
5.09670472778234.0967047277823
Output for 5.4.9
5.19655955405754.1965595540575
Output for 5.4.8
5.27091662016274.2709166201627
Output for 5.4.7
4.82452002927873.8245200292787
Output for 5.4.6
4.58611200148523.5861120014852
Output for 5.4.5
5.21093915133324.2109391513332
Output for 5.4.4
5.36252631054384.3625263105438
Output for 5.4.3
4.55278376632033.5527837663203
Output for 5.4.2
4.81559912246453.8155991224645
Output for 5.4.1
5.38738809055064.3873880905506
Output for 5.4.0
5.10057637682214.1005763768221
Output for 5.3.29
5.48581172315674.4858117231567
Output for 5.3.28
5.3877643118094.387764311809
Output for 5.3.27
4.84518499828193.8451849982819
Output for 5.3.26
4.7933079312993.793307931299
Output for 5.3.25
4.94361111705363.9436111170536
Output for 5.3.24
5.3818488192664.381848819266
Output for 5.3.23
5.25108591408984.2510859140898
Output for 5.3.22
5.01313898433614.0131389843361
Output for 5.3.21
5.14919094841424.1491909484142
Output for 5.3.20
4.97812372212213.9781237221221
Output for 5.3.19
4.92420030474863.9242003047486
Output for 5.3.18
4.62924718839553.6292471883955
Output for 5.3.17
5.19167352849234.1916735284923
Output for 5.3.16
5.26200878166694.2620087816669
Output for 5.3.15
4.69468730767013.6946873076701
Output for 5.3.14
5.17348650525024.1734865052502
Output for 5.3.13
4.69883103351993.6988310335199
Output for 5.3.12
4.77275633405563.7727563340556
Output for 5.3.11
5.47678330795694.4767833079569
Output for 5.3.10
4.53691545200393.5369154520039
Output for 5.3.9
5.03676666763464.0367666676346
Output for 5.3.8
4.62918690178973.6291869017897
Output for 5.3.7
5.29219489651374.2921948965137
Output for 5.3.6
5.04679258938264.0467925893826
Output for 5.3.5
5.03370234395084.0337023439508
Output for 5.3.4
4.67964346109873.6796434610987
Output for 5.3.3
4.67092872721653.6709287272165
Output for 5.3.2
5.01696240832894.0169624083289
Output for 5.3.1
4.57591715272333.5759171527233
Output for 5.3.0
4.92086251262623.9208625126262
Output for 5.2.17
5.36755254718834.3675525471883
Output for 5.2.16
4.65264575027523.6526457502752
Output for 5.2.15
5.29562334473974.2956233447397
Output for 5.2.14
4.52831059835313.5283105983531
Output for 5.2.13
4.71748255343063.7174825534306
Output for 5.2.12
5.12961026287154.1296102628715
Output for 5.2.11
5.17698259101114.1769825910111
Output for 5.2.10
4.73280516394083.7328051639408
Output for 5.2.9
5.29238002178844.2923800217884
Output for 5.2.8
4.58323429226093.5832342922609
Output for 5.2.7
4.61010300140373.6101030014037
Output for 5.2.6
5.31972582420324.3197258242032
Output for 5.2.5
4.71282868469733.7128286846973
Output for 5.2.4
4.53702847032673.5370284703267
Output for 5.2.3
5.40062680905714.4006268090571
Output for 5.2.2
4.75419919484023.7541991948402
Output for 5.2.1
4.80620475383763.8062047538376
Output for 5.2.0
4.9937948663693.993794866369
Output for 5.1.6
5.30516787260084.3051678726008
Output for 5.1.5
5.34591192931214.3459119293121
Output for 5.1.4
5.45728098529264.4572809852926
Output for 5.1.3
5.35800140973094.3580014097309
Output for 5.1.2
5.01068376750254.0106837675025
Output for 5.1.1
4.60138466470013.6013846647001
Output for 5.1.0
5.34048789196674.3404878919667
Output for 5.0.5
5.05514331024854.0551433102485
Output for 5.0.4
4.66714126787483.6671412678748
Output for 5.0.3
4.69830021806913.6983002180691
Output for 5.0.2
4.7120021179843.712002117984
Output for 5.0.1
5.05320869668074.0532086966807
Output for 5.0.0
5.41960414192624.4196041419262
Output for 4.4.9
5.01387882838674.0138788283867
Output for 4.4.8
5.09873897004814.0987389700481
Output for 4.4.7
5.20062257056154.2006225705615
Output for 4.4.6
4.64486285655053.6448628565505
Output for 4.4.5
5.2709884048774.270988404877
Output for 4.4.4
5.43290000568744.4329000056874
Output for 4.4.3
4.90365621675913.9036562167591
Output for 4.4.2
5.28047002469214.2804700246921
Output for 4.4.1
5.01642798749564.0164279874956
Output for 4.4.0
5.44804457153574.4480445715357
Output for 4.3.11
4.57789472005233.5778947200523
Output for 4.3.10
5.18061296114734.1806129611473
Output for 4.3.9
4.99165244516533.9916524451653
Output for 4.3.8
4.94101651173133.9410165117313
Output for 4.3.7
5.13511969504654.1351196950465
Output for 4.3.6
5.2607034986194.260703498619
Output for 4.3.5
5.27766668367094.2776666836709
Output for 4.3.4
5.22430099231394.2243009923139
Output for 4.3.3
5.40910066822974.4091006682297
Output for 4.3.2
5.2463076406844.246307640684
Output for 4.3.1
4.63060669211233.6306066921123
Output for 4.3.0
4.66908729643053.6690872964305