3v4l.org

run code in 300+ PHP versions simultaneously
<?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.2.0
9 0.032618999481201 10 0.061191082000732 11 0.12331199645996 12 0.24576497077942 13 0.47783899307251 14 0.97306704521179
Process exited with code 137.
Output for 7.1.7
9 0.041976928710938 10 0.079597949981689 11 0.14361000061035 12 0.23951697349548 13 0.48135495185852 14 0.95149087905884
Process exited with code 137.
Output for 7.1.6
9 0.063961029052734 10 0.090440034866333 11 0.12866187095642 12 0.24402689933777 13 0.48790693283081 14 0.94564199447632
Process exited with code 137.
Output for 7.1.5
9 0.032916069030762 10 0.061522960662842 11 0.12330603599548 12 0.24543905258179 13 0.45914101600647 14 0.92152905464172
Process exited with code 137.
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.20
9 0.029849052429199 10 0.05985689163208 11 0.12040781974792 12 0.23987102508545 13 0.47636604309082 14 0.95652008056641
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.092818975448608 10 0.065160036087036 11 0.2525680065155 12 0.50945806503296 13 0.95691895484924
Process exited with code 137.
Output for 5.4.22
9 0.093797922134399 10 0.06540584564209 11 0.31176209449768 12 0.45503902435303 13 0.95669794082642
Process exited with code 137.
Output for 5.4.21
9 0.036773204803467 10 0.12958598136902 11 0.25459408760071 12 0.44752097129822 13 1.0190999507904
Process exited with code 137.
Output for 5.4.20
9 0.093912839889526 10 0.12662291526794 11 0.25403380393982 12 0.44390606880188 13 0.93186116218567
Process exited with code 137.
Output for 5.4.19
9 0.032980918884277 10 0.12769103050232 11 0.2235848903656 12 0.50509309768677 13 0.9580659866333
Process exited with code 137.
Output for 5.4.18
9 0.033622980117798 10 0.15671586990356 11 0.19709801673889 12 0.54657888412476 13 1.0021188259125
Process exited with code 137.
Output for 5.4.17
9 0.033156156539917 10 0.12775111198425 11 0.25268816947937 12 0.51535606384277 13 0.89853286743164
Process exited with code 137.
Output for 5.4.16
9 0.093431949615479 10 0.12822508811951 11 0.19311499595642 12 0.51263380050659 13 0.98276686668396
Process exited with code 137.
Output for 5.4.15
9 0.12511396408081 10 0.13285779953003 11 0.22564196586609 12 0.52319884300232 13 0.98416805267334
Process exited with code 137.
Output for 5.4.14
9 0.032845973968506 10 0.15809106826782 11 0.25785899162292 12 0.513592004776 13 0.95322799682617
Process exited with code 137.
Output for 5.4.13
9 0.094661951065063 10 0.12826204299927 11 0.25664520263672 12 0.4536349773407 13 0.9646430015564
Process exited with code 137.
Output for 5.4.12
9 0.095064878463745 10 0.068785190582275 11 0.32620000839233 12 0.51733493804932 13 0.9636561870575
Process exited with code 137.
Output for 5.4.11
9 0.096739053726196 10 0.1309289932251 11 0.26332116127014 12 0.52785110473633 13 1.014358997345
Process exited with code 137.
Output for 5.4.10
9 0.035099983215332 10 0.12947988510132 11 0.29408001899719 12 0.56115698814392
Process exited with code 137.
Output for 5.4.9
9 0.096143960952759 10 0.12877583503723 11 0.26294493675232 12 0.45294785499573 13 0.96790909767151
Process exited with code 137.
Output for 5.4.8
9 0.035950183868408 10 0.12771391868591 11 0.25583505630493 12 0.45172381401062 13 1.0019719600677
Process exited with code 137.
Output for 5.4.7
9 0.034465074539185 10 0.1290180683136 11 0.25761604309082 12 0.51067519187927 13 0.96818089485168
Process exited with code 137.
Output for 5.4.6
9 0.033811092376709 10 0.06744909286499 11 0.13595104217529 12 0.274827003479 13 0.53662109375 14 1.1117379665375
Process exited with code 137.
Output for 5.4.5
9 0.035979032516479 10 0.067670106887817 11 0.14027881622314 12 0.27053594589233 13 0.58242201805115
Process exited with code 137.
Output for 5.4.4
9 0.034209012985229 10 0.068660974502563 11 0.13537287712097 12 0.26704406738281 13 0.54396510124207 14 1.1135430335999
Process exited with code 137.
Output for 5.4.3
9 0.03402304649353 10 0.067614078521729 11 0.13551497459412 12 0.27383899688721 13 0.57558083534241
Process exited with code 137.
Output for 5.4.2
9 0.033687114715576 10 0.067012071609497 11 0.13551211357117 12 0.278235912323 13 0.60997104644775
Process exited with code 137.
Output for 5.4.1
9 0.034008979797363 10 0.066388130187988 11 0.13557505607605 12 0.26792097091675 13 0.54137706756592 14 1.0764169692993
Process exited with code 137.
Output for 5.4.0
9 0.033474922180176 10 0.0660080909729 11 0.13604712486267 12 0.29734396934509 13 0.52867317199707
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.095201015472412 10 0.071964979171753 11 0.17250895500183 12 0.33233785629272 13 0.60994601249695
Process exited with code 137.
Output for 5.3.27
9 0.034671068191528 10 0.067800045013428 11 0.13508701324463 12 0.30205392837524 13 0.54385495185852
Process exited with code 137.
Output for 5.3.26
9 0.033106088638306 10 0.068521022796631 11 0.13468790054321 12 0.26755714416504 13 0.53154897689819 14 1.0914809703827
Process exited with code 137.
Output for 5.3.25
9 0.093689918518066 10 0.068585872650146 11 0.13579201698303 12 0.2713930606842 13 0.54890394210815
Process exited with code 137.
Output for 5.3.24
9 0.032840013504028 10 0.066209077835083 11 0.13324689865112 12 0.26248788833618 13 0.52902984619141 14 1.060672044754
Process exited with code 137.
Output for 5.3.23
9 0.033438920974731 10 0.068425178527832 11 0.13619589805603 12 0.29858303070068 13 0.53339409828186 14 1.1174919605255
Process exited with code 137.
Output for 5.3.22
9 0.034698963165283 10 0.071681976318359 11 0.13228893280029 12 0.26633501052856 13 0.53796100616455 14 1.0724830627441
Process exited with code 137.
Output for 5.3.21
9 0.033330202102661 10 0.066383838653564 11 0.13359713554382 12 0.26721978187561 13 0.53609204292297 14 1.0764420032501
Process exited with code 137.
Output for 5.3.20
9 0.093938112258911 10 0.067694902420044 11 0.13271903991699 12 0.33084201812744 13 1.0488119125366
Process exited with code 137.
Output for 5.3.19
9 0.034690856933594 10 0.12961292266846 11 0.26446294784546 12 0.57718801498413 13 0.97328805923462
Process exited with code 137.
Output for 5.3.18
9 0.033601999282837 10 0.1293580532074 11 0.25271677970886 12 0.54487299919128 13 1.0566029548645
Process exited with code 137.
Output for 5.3.17
9 0.034638166427612 10 0.19009590148926 11 0.19452500343323 12 0.51395916938782 13 0.96680402755737
Process exited with code 137.
Output for 5.3.16
9 0.094711065292358 10 0.14359402656555 11 0.22643899917603 12 0.51245999336243 13 1.039981842041
Process exited with code 137.
Output for 5.3.15
9 0.094743013381958 10 0.074492931365967 11 0.2837221622467 12 0.48313689231873 13 1.1185510158539
Process exited with code 137.
Output for 5.3.14
9 0.034240007400513 10 0.1267352104187 11 0.26158595085144 12 0.53957319259644 13 1.1282291412354
Process exited with code 137.
Output for 5.3.13
9 0.034198999404907 10 0.16071391105652 11 0.31358098983765 12 0.54880404472351
Process exited with code 137.
Output for 5.3.12
9 0.036321878433228 10 0.19557499885559 11 0.23464202880859 12 0.57511901855469 13 1.0513489246368
Process exited with code 137.
Output for 5.3.11
9 0.095144033432007 10 0.1291389465332 11 0.22702598571777 12 0.55518794059753 13 0.98556208610535
Process exited with code 137.
Output for 5.3.10
9 0.034253835678101 10 0.19129586219788 11 0.20045495033264 12 0.55047988891602 13 1.0901048183441
Process exited with code 137.
Output for 5.3.9
9 0.094308853149414 10 0.067863941192627 11 0.25533103942871 12 0.51436996459961 13 0.99045991897583
Process exited with code 137.
Output for 5.3.8
9 0.036005973815918 10 0.13224411010742 11 0.25414681434631 12 0.46458292007446 13 1.1328039169312
Process exited with code 137.
Output for 5.3.7
9 0.094956874847412 10 0.12870907783508 11 0.26172590255737 12 0.4490327835083 13 0.976557970047
Process exited with code 137.
Output for 5.3.6
9 0.00028395652770996 10 1.0013580322266E-5 11 8.8214874267578E-6 12 1.0013580322266E-5 13 7.8678131103516E-6 14 7.8678131103516E-6 15 8.8214874267578E-6 Notice: Undefined variable: recommended in /in/I0Qrf on line 23 recommended cost param for this environment:
Output for 5.3.5
9 0.00029897689819336 10 0.00026988983154297 11 0.00027704238891602 12 0.00028705596923828 13 0.00027799606323242 14 0.00027704238891602 15 0.00028300285339355 Notice: Undefined variable: recommended in /in/I0Qrf on line 23 recommended cost param for this environment:

preferences:
114.65 ms | 402 KiB | 117 Q