3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function bcryptWithCost($cost) { $cost = str_pad($cost, 2, '0', STR_PAD_LEFT); crypt('password', '$2y$' . $cost . '$thisisasaltthisisasalt'); } $costs = range(9, 15); foreach ($costs as $cost) { $timestamp = microtime(true); bcryptWithCost($cost); $time = microtime(true) - $timestamp; echo $cost . ' ' . $time . PHP_EOL; if (!isset($recommended) && $time >= 0.5) { $recommended = $cost; } if (isset($recommended) && $time < 0.9) { $recommended = $cost; } } echo "recommended cost param for this environment: $recommended\n";
Output for 7.1.0
9 0.046212911605835 10 0.076004028320312 11 0.12084102630615 12 0.21398711204529 13 0.4277811050415 14 0.85616087913513
Process exited with code 137.
Output for 7.0.14
9 0.04645299911499 10 0.074318885803223 11 0.11469006538391 12 0.21396398544312 13 -0.23775696754456 14 1.144543170929
Process exited with code 137.
Output for 7.0.6
9 0.040557146072388 10 0.062889814376831 11 0.12216997146606 12 0.24435496330261 13 0.48518490791321 14 0.95886898040771
Process exited with code 137.
Output for 7.0.5
9 0.03249192237854 10 0.061049938201904 11 0.12193179130554 12 0.2435610294342 13 0.4721360206604 14 0.94025492668152
Process exited with code 137.
Output for 7.0.4
9 0.041992902755737 10 0.068130016326904 11 0.12185192108154 12 0.24373483657837 13 0.48267102241516 14 0.94379711151123
Process exited with code 137.
Output for 7.0.3
9 0.037726879119873 10 0.063811063766479 11 0.12166786193848 12 0.24320077896118 13 0.47843194007874 14 0.94399785995483
Process exited with code 137.
Output for 7.0.2
9 0.033648014068604 10 0.061238050460815 11 0.12230706214905 12 0.24439787864685 13 0.47912406921387 14 0.95106911659241
Process exited with code 137.
Output for 7.0.1
9 0.041465044021606 10 0.067329168319702 11 0.12177681922913 12 0.24337196350098 13 0.48453712463379 14 0.94342994689941
Process exited with code 137.
Output for 7.0.0
9 0.03593897819519 10 0.062419891357422 11 0.1217999458313 12 0.24423503875732 13 0.47942519187927 14 0.94727802276611
Process exited with code 137.
Output for 5.6.28
9 0.048275947570801 10 0.078840970993042 11 0.12403798103333 12 0.21416091918945 13 0.032143115997314 14 1.1436848640442
Process exited with code 137.
Output for 5.6.21
9 0.044361114501953 10 0.068206787109375 11 0.12174797058105 12 0.24318480491638 13 0.48304390907288 14 0.94953393936157
Process exited with code 137.
Output for 5.6.20
9 0.043616056442261 10 0.070338010787964 11 0.12211108207703 12 0.24372482299805 13 0.48309993743896 14 0.94639301300049
Process exited with code 137.
Output for 5.6.19
9 0.030673027038574 10 0.061228036880493 11 0.12230801582336 12 0.24048709869385 13 0.47464680671692 14 0.94320917129517
Process exited with code 137.
Output for 5.6.18
9 0.029965877532959 10 0.059376955032349 11 0.11841917037964 12 0.23664212226868 13 0.47372603416443 14 0.94774913787842
Process exited with code 137.
Output for 5.6.17
9 0.040801048278809 10 0.066802024841309 11 0.12181282043457 12 0.24354290962219 13 0.48457312583923 14 0.94543099403381
Process exited with code 137.
Output for 5.6.16
9 0.043344974517822 10 0.066146850585938 11 0.12244200706482 12 0.24469089508057 13 0.48424291610718 14 0.94586396217346
Process exited with code 137.
Output for 5.6.15
9 0.033227920532227 10 0.061223030090332 11 0.12181901931763 12 0.24370503425598 13 0.47540593147278 14 0.93633985519409
Process exited with code 137.
Output for 5.6.14
9 0.029705047607422 10 0.059216022491455 11 0.11839890480042 12 0.23674297332764 13 0.47298192977905 14 0.94358611106873
Process exited with code 137.
Output for 5.6.13
9 0.030666828155518 10 0.060965061187744 11 0.12181210517883 12 0.24069499969482 13 0.47270703315735 14 0.94113421440125
Process exited with code 137.
Output for 5.6.12
9 0.037152051925659 10 0.063407182693481 11 0.12181997299194 12 0.24349904060364 13 0.47795295715332 14 0.94408416748047
Process exited with code 137.
Output for 5.6.11
9 0.044575929641724 10 0.071063041687012 11 0.12278604507446 12 0.24454283714294 13 0.48634099960327 14 0.95758509635925
Process exited with code 137.
Output for 5.6.10
9 0.038155078887939 10 0.064424991607666 11 0.12375688552856 12 0.2461941242218 13 0.48417496681213 14 0.95535111427307
Process exited with code 137.
Output for 5.6.9
9 0.04200291633606 10 0.068408012390137 11 0.12241077423096 12 0.24569296836853 13 0.48558592796326 14 0.94216012954712
Process exited with code 137.
Output for 5.6.8
9 0.04128098487854 10 0.067310094833374 11 0.12376689910889 12 0.24633598327637 13 0.48733687400818 14 0.96076607704163
Process exited with code 137.
Output for 5.6.7
9 0.030646800994873 10 0.061135053634644 11 0.12188506126404 12 0.24364399909973 13 0.41018390655518 14 0.80234098434448
Process exited with code 137.
Output for 5.5.35
9 0.038510084152222 10 0.064578056335449 11 0.12159895896912 12 0.24335479736328 13 0.4528501033783 14 0.80214905738831
Process exited with code 137.
Output for 5.5.34
9 0.039689064025879 10 0.066210985183716 11 0.12230491638184 12 0.24450397491455 13 0.48527193069458 14 0.94873285293579
Process exited with code 137.
Output for 5.5.33
9 0.042964935302734 10 0.069282054901123 11 0.12241387367249 12 0.24472999572754 13 0.4871039390564 14 0.94967198371887
Process exited with code 137.
Output for 5.5.32
9 0.036437034606934 10 0.061830043792725 11 0.1188588142395 12 0.23636889457703 13 0.46943593025208 14 0.94618105888367
Process exited with code 137.
Output for 5.5.31
9 0.032895088195801 10 0.062232971191406 11 0.12450790405273 12 0.248948097229 13 0.48800897598267 14 0.9711229801178
Process exited with code 137.
Output for 5.5.30
9 0.030756950378418 10 0.061279058456421 11 0.12245488166809 12 0.24472188949585 13 0.47547197341919 14 0.94657206535339
Process exited with code 137.
Output for 5.5.29
9 0.029859066009521 10 0.059484958648682 11 0.11831188201904 12 0.23607897758484 13 0.4738872051239 14 0.94846200942993
Process exited with code 137.
Output for 5.5.28
9 0.03068995475769 10 0.061239004135132 11 0.11954021453857 12 0.23650407791138 13 0.47300004959106 14 0.94465589523315
Process exited with code 137.
Output for 5.5.27
9 0.030659914016724 10 0.060971021652222 11 0.12177801132202 12 0.24345803260803 13 0.47564387321472 14 0.94484806060791
Process exited with code 137.
Output for 5.5.26
9 0.044312953948975 10 0.064698934555054 11 0.12164092063904 12 0.24315810203552 13 0.47863411903381 14 0.94574093818665
Process exited with code 137.
Output for 5.5.25
9 0.042642116546631 10 0.063594818115234 11 0.12163782119751 12 0.24313902854919 13 0.48228812217712 14 0.95151114463806
Process exited with code 137.
Output for 5.5.24
9 0.030208110809326 10 0.059117078781128 11 0.11816096305847 12 0.23618102073669 13 0.47473311424255 14 0.94841384887695
Process exited with code 137.
Output for 5.4.45
9 0.036347150802612 10 0.062243938446045 11 0.12204313278198 12 0.24353098869324 13 0.47960305213928 14 0.94570899009705
Process exited with code 137.
Output for 5.4.44
9 0.030658960342407 10 0.061176061630249 11 0.12214303016663 12 0.24421906471252 13 0.46728801727295 14 0.95061707496643
Process exited with code 137.
Output for 5.4.43
9 0.040932893753052 10 0.063485145568848 11 0.1221067905426 12 0.24400401115417 13 0.48267579078674 14 0.94390296936035
Process exited with code 137.
Output for 5.4.42
9 0.030657052993774 10 0.061078071594238 11 0.12186503410339 12 0.23696208000183 13 0.46956610679626 14 0.9417839050293
Process exited with code 137.
Output for 5.4.41
9 0.032006978988647 10 0.061400890350342 11 0.12245416641235 12 0.24462699890137 13 0.48165893554688 14 0.94809293746948
Process exited with code 137.
Output for 5.4.40
9 0.02982497215271 10 0.059257984161377 11 0.11849689483643 12 0.2370069026947 13 0.47385382652283 14 0.94634914398193
Process exited with code 137.
Output for 5.4.39
9 0.030736923217773 10 0.061056852340698 11 0.11963081359863 12 0.23730206489563 13 0.4751980304718 14 0.94750809669495
Process exited with code 137.
Output for 5.4.38
9 0.038172960281372 10 0.064300060272217 11 0.1223578453064 12 0.24438095092773 13 0.48270797729492 14 0.94789481163025
Process exited with code 137.
Output for 5.4.37
9 0.035358905792236 10 0.062407970428467 11 0.12220096588135 12 0.24403691291809 13 0.48161387443542 14 0.94860482215881
Process exited with code 137.
Output for 5.4.36
9 0.034462928771973 10 0.062129974365234 11 0.12576198577881 12 0.24406409263611 13 0.48289489746094 14 0.94906687736511
Process exited with code 137.
Output for 5.4.35
9 0.041879177093506 10 0.068001985549927 11 0.12211489677429 12 0.24418997764587 13 0.48445391654968 14 0.94068384170532
Process exited with code 137.
Output for 5.4.34
9 0.042356967926025 10 0.068573951721191 11 0.12223601341248 12 0.24410796165466 13 0.48372507095337 14 0.94931793212891
Process exited with code 137.
Output for 5.4.32
9 0.030734062194824 10 0.061334133148193 11 0.12242317199707 12 0.2426700592041 13 0.47568416595459 14 0.94824910163879
Process exited with code 137.
Output for 5.4.31
9 0.034630060195923 10 0.062389135360718 11 0.1224479675293 12 0.24419593811035 13 0.48215198516846 14 0.95020890235901
Process exited with code 137.
Output for 5.4.30
9 0.033057928085327 10 0.06600284576416 11 0.13979411125183 12 0.27380800247192 13 0.52599191665649
Process exited with code 137.
Output for 5.4.29
9 0.030133008956909 10 0.06013011932373 11 0.11934590339661 12 0.2437150478363 13 0.48473715782166 14 0.96119999885559
Process exited with code 137.
Output for 5.4.28
9 0.030265092849731 10 0.061043977737427 11 0.11974811553955 12 0.2471809387207 13 0.48079800605774 14 0.96075797080994
Process exited with code 137.
Output for 5.4.27
9 0.031217098236084 10 0.060886144638062 11 0.12203693389893 12 0.24581098556519 13 0.48084712028503 14 0.97189497947693
Process exited with code 137.
Output for 5.4.26
9 0.029849052429199 10 0.059548854827881 11 0.11948084831238 12 0.23847794532776 13 0.48799896240234 14 1.0121378898621
Process exited with code 137.
Output for 5.4.25
9 0.031582117080688 10 0.062597990036011 11 0.12511396408081 12 0.24718713760376 13 0.48644113540649
Process exited with code 137.
Output for 5.4.24
9 0.030788898468018 10 0.068826198577881 11 0.12334394454956 12 0.24368000030518 13 0.49620294570923 14 0.99852919578552
Process exited with code 137.
Output for 5.4.23
9 0.030075073242188 10 0.062698841094971 11 0.12099885940552 12 0.23899102210999 13 0.53658819198608 14 1.0417320728302
Process exited with code 137.
Output for 5.4.22
9 0.03193998336792 10 0.063878059387207 11 0.12615895271301 12 0.25026488304138 13 0.48982095718384 14 1.0148379802704
Process exited with code 137.
Output for 5.4.21
9 0.031603813171387 10 0.065364122390747 11 0.14823818206787 12 0.25895404815674 13 0.51077699661255
Process exited with code 137.
Output for 5.4.20
9 0.031115055084229 10 0.073253870010376 11 0.15565395355225 12 0.32136583328247 13 0.55044507980347
Process exited with code 137.
Output for 5.4.19
9 0.030846834182739 10 0.060517072677612 11 0.12419605255127 12 0.24324107170105 13 0.50493478775024 14 1.0108249187469
Process exited with code 137.
Output for 5.4.18
9 0.031620025634766 10 0.063561916351318 11 0.12903690338135 12 0.26691508293152 13 0.61536288261414
Process exited with code 137.
Output for 5.4.17
9 0.031644105911255 10 0.14952993392944 11 0.25614094734192 12 0.46141719818115 13 0.84949803352356
Process exited with code 137.
Output for 5.4.16
9 0.032681941986084 10 0.085269927978516 11 0.24603605270386 12 0.42798900604248 13 0.98969697952271
Process exited with code 137.
Output for 5.4.15
9 0.058966875076294 10 0.12948107719421 11 0.22620487213135 12 0.36336588859558 13 0.78880906105042
Process exited with code 137.
Output for 5.4.14
9 0.030273914337158 10 0.060357093811035 11 0.12058401107788 12 0.24088501930237 13 0.46146512031555 14 0.92569613456726
Process exited with code 137.
Output for 5.4.13
9 0.039717197418213 10 0.065824031829834 11 0.12061619758606 12 0.24099397659302 13 0.47778296470642 14 0.94015097618103
Process exited with code 137.
Output for 5.4.12
9 0.030327081680298 10 0.06066107749939 11 0.12107610702515 12 0.23620200157166 13 0.46797585487366 14 0.93752598762512
Process exited with code 137.
Output for 5.4.11
9 0.036128044128418 10 0.068474054336548 11 0.13512492179871 12 0.27210903167725 13 0.53760409355164 14 1.0707030296326
Process exited with code 137.
Output for 5.4.10
9 0.041779041290283 10 0.066594123840332 11 0.12212705612183 12 0.24417686462402 13 0.48277497291565 14 0.96144914627075
Process exited with code 137.
Output for 5.4.9
9 0.029781818389893 10 0.059220790863037 11 0.11835503578186 12 0.23654294013977 13 0.47357487678528 14 0.94745779037476
Process exited with code 137.
Output for 5.4.8
9 0.045524835586548 10 0.072537183761597 11 0.12254190444946 12 0.24421215057373 13 0.48522901535034 14 0.94889211654663
Process exited with code 137.
Output for 5.4.7
9 0.042682886123657 10 0.068893909454346 11 0.12231087684631 12 0.24445605278015 13 0.48424005508423 14 0.95185494422913
Process exited with code 137.
Output for 5.4.6
9 0.046238899230957 10 0.072120904922485 11 0.12258100509644 12 0.24428606033325 13 0.48519802093506 14 0.9523069858551
Process exited with code 137.
Output for 5.4.5
9 0.031184911727905 10 0.059865951538086 11 0.11936688423157 12 0.23907589912415 13 0.47576093673706 14 0.95047616958618
Process exited with code 137.
Output for 5.4.4
9 0.045520067214966 10 0.071719884872437 11 0.1220600605011 12 0.24331998825073 13 0.48367190361023 14 0.94910192489624
Process exited with code 137.
Output for 5.4.3
9 0.044344902038574 10 0.070664882659912 11 0.12196111679077 12 0.24342393875122 13 0.48206901550293 14 0.94078302383423
Process exited with code 137.
Output for 5.4.2
9 0.040549039840698 10 0.066896915435791 11 0.1241250038147 12 0.24819302558899 13 0.49030089378357 14 0.96693205833435
Process exited with code 137.
Output for 5.4.1
9 0.03063702583313 10 0.061053991317749 11 0.12198400497437 12 0.24389910697937 13 0.47295689582825 14 0.94434595108032
Process exited with code 137.
Output for 5.4.0
9 0.029092073440552 10 0.057746171951294 11 0.1150529384613 12 0.22822999954224 13 0.45950293540955 14 0.92232894897461
Process exited with code 137.
Output for 5.3.29
9 0.029485940933228 10 0.058887004852295 11 0.11737704277039 12 0.23377704620361 13 0.46721410751343 14 0.9334409236908
Process exited with code 137.
Output for 5.3.28
9 0.029240846633911 10 0.057773113250732 11 0.11629819869995 12 0.23094391822815 13 0.46725010871887 14 0.9419629573822
Process exited with code 137.
Output for 5.3.27
9 0.030444860458374 10 0.060688018798828 11 0.12116003036499 12 0.24212908744812 13 0.47243404388428 14 0.93904209136963
Process exited with code 137.
Output for 5.3.26
9 0.062808990478516 10 0.085205078125 11 0.12540698051453 12 0.24215602874756 13 0.48299098014832 14 0.94170308113098
Process exited with code 137.
Output for 5.3.25
9 0.030385971069336 10 0.060689926147461 11 0.12155199050903 12 0.24320697784424 13 0.47453999519348 14 0.94146299362183
Process exited with code 137.
Output for 5.3.24
9 0.038048028945923 10 0.064762115478516 11 0.12150001525879 12 0.24263000488281 13 0.47917509078979 14 0.94206094741821
Process exited with code 137.
Output for 5.3.23
9 0.029819965362549 10 0.058178901672363 11 0.11596083641052 12 0.23584294319153 13 0.46939897537231 14 0.93598198890686
Process exited with code 137.
Output for 5.3.22
9 0.030380010604858 10 0.060587167739868 11 0.12096786499023 12 0.24165081977844 13 0.47438478469849 14 0.94248604774475
Process exited with code 137.
Output for 5.3.21
9 0.029633045196533 10 0.058718919754028 11 0.1157648563385 12 0.23116397857666 13 0.46610188484192 14 0.92888903617859
Process exited with code 137.
Output for 5.3.20
9 0.029531955718994 10 0.05856990814209 11 0.11544108390808 12 0.22949981689453 13 0.46044087409973 14 0.92307710647583
Process exited with code 137.
Output for 5.3.19
9 0.029407978057861 10 0.05864691734314 11 0.11715388298035 12 0.23417520523071 13 0.46820211410522 14 0.93630123138428
Process exited with code 137.
Output for 5.3.18
9 0.066891193389893 10 0.087924003601074 11 0.12613606452942 12 0.24168801307678 13 0.48130702972412 14 0.93860292434692
Process exited with code 137.
Output for 5.3.17
9 0.046531915664673 10 0.072694063186646 11 0.12150812149048 12 0.24174690246582 13 0.48016500473022 14 0.9341938495636
Process exited with code 137.
Output for 5.3.16
9 0.04046106338501 10 0.066317081451416 11 0.12089800834656 12 0.24178504943848 13 0.47907495498657 14 0.93948698043823
Process exited with code 137.
Output for 5.3.15
9 0.037413120269775 10 0.063462018966675 11 0.12114787101746 12 0.2420928478241 13 0.47895693778992 14 0.93569707870483
Process exited with code 137.
Output for 5.3.14
9 0.029717206954956 10 0.059117794036865 11 0.11712598800659 12 0.2333550453186 13 0.46344399452209 14 0.93882298469543
Process exited with code 137.
Output for 5.3.13
9 0.04010009765625 10 0.066085815429688 11 0.12099695205688 12 0.24202799797058 13 0.47924709320068 14 0.93567705154419
Process exited with code 137.
Output for 5.3.12
9 0.039921045303345 10 0.066199064254761 11 0.11545991897583 12 0.23085784912109 13 0.46101999282837 14 0.93287897109985
Process exited with code 137.
Output for 5.3.11
9 0.040148973464966 10 0.065946102142334 11 0.12085914611816 12 0.24152994155884 13 0.47556400299072 14 0.93097400665283
Process exited with code 137.
Output for 5.3.10
9 0.029489994049072 10 0.058967113494873 11 0.11662912368774 12 0.23255300521851 13 0.47010397911072 14 0.93696999549866
Process exited with code 137.
Output for 5.3.9
9 0.040539026260376 10 0.066962957382202 11 0.12006115913391 12 0.24023294448853 13 0.4773108959198 14 0.91951704025269
Process exited with code 137.
Output for 5.3.8
9 0.030236959457397 10 0.060121059417725 11 0.12008595466614 12 0.23439407348633 13 0.4664409160614 14 0.93136715888977
Process exited with code 137.
Output for 5.3.7
9 0.029356002807617 10 0.058336019515991 11 0.11629009246826 12 0.23240303993225 13 0.46532797813416 14 0.92947483062744
Process exited with code 137.
Output for 5.3.6
9 0.00033307075500488 10 1.0013580322266E-5 11 6.9141387939453E-6 12 8.1062316894531E-6 13 7.1525573730469E-6 14 7.1525573730469E-6 15 7.1525573730469E-6 Notice: Undefined variable: recommended in /in/I0Qrf on line 23 recommended cost param for this environment:
Output for 5.3.5
9 0.00026512145996094 10 0.00021004676818848 11 0.00020003318786621 12 0.00019502639770508 13 0.00019192695617676 14 0.00018787384033203 15 0.00018906593322754 Notice: Undefined variable: recommended in /in/I0Qrf on line 23 recommended cost param for this environment:
Output for 5.2.17

Process exited with code 139.