3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $n=999999; $a=1; $b=2; $start=microtime(1); for($i=1;$i<=$n;$i++) { if ($a!=$b) $c=$a+$b;else $c=8; } print 'normal: '.(microtime(1)-$start)."\n"; $start=microtime(1); for($i=1;$i<=$n;$i++) { $c=($a!=$b)?($a+$b):8; } print 'ternary: '.(microtime(1)-$start)."\n";
Output for 7.1.0
normal: 0.025830030441284 ternary: 0.025869131088257
Output for 7.0.14
normal: 0.02861213684082 ternary: 0.027103900909424
Output for 7.0.12
normal: 0.031620025634766 ternary: 0.028305053710938
Output for 7.0.6
normal: 0.023313999176025 ternary: 0.020090103149414
Output for 7.0.5
normal: 0.026714086532593 ternary: 0.025232076644897
Output for 7.0.4
normal: 0.021528959274292 ternary: 0.019678115844727
Output for 7.0.3
normal: 0.024304866790771 ternary: 0.018222808837891
Output for 7.0.2
normal: 0.026125907897949 ternary: 0.023924827575684
Output for 7.0.1
normal: 0.017321109771729 ternary: 0.017658948898315
Output for 7.0.0
normal: 0.017438888549805 ternary: 0.018973112106323
Output for 5.6.28
normal: 0.063611030578613 ternary: 0.071976184844971
Output for 5.6.21
normal: 0.044653177261353 ternary: 0.044142961502075
Output for 5.6.20
normal: 0.058652877807617 ternary: 0.046738862991333
Output for 5.6.19
normal: 0.058195114135742 ternary: 0.04832911491394
Output for 5.6.18
normal: 0.040853023529053 ternary: 0.042775869369507
Output for 5.6.17
normal: 0.055988073348999 ternary: 0.049254894256592
Output for 5.6.16
normal: 0.048604965209961 ternary: 0.046541929244995
Output for 5.6.15
normal: 0.042065143585205 ternary: 0.041943788528442
Output for 5.6.14
normal: 0.057669878005981 ternary: 0.05141806602478
Output for 5.6.13
normal: 0.040539026260376 ternary: 0.041713953018188
Output for 5.6.12
normal: 0.039655923843384 ternary: 0.041896104812622
Output for 5.6.11
normal: 0.057893037796021 ternary: 0.048328161239624
Output for 5.6.10
normal: 0.055421113967896 ternary: 0.048099994659424
Output for 5.6.9
normal: 0.051286935806274 ternary: 0.052918195724487
Output for 5.6.8
normal: 0.057312965393066 ternary: 0.043675899505615
Output for 5.5.35
normal: 0.041765928268433 ternary: 0.043195009231567
Output for 5.5.34
normal: 0.051474094390869 ternary: 0.045289993286133
Output for 5.5.33
normal: 0.039623022079468 ternary: 0.041990995407104
Output for 5.5.32
normal: 0.048247098922729 ternary: 0.045759916305542
Output for 5.5.31
normal: 0.045321941375732 ternary: 0.043730974197388
Output for 5.5.30
normal: 0.0412278175354 ternary: 0.043136119842529
Output for 5.5.29
normal: 0.052680969238281 ternary: 0.046612024307251
Output for 5.5.28
normal: 0.048877000808716 ternary: 0.054053068161011
Output for 5.5.27
normal: 0.053385972976685 ternary: 0.04800820350647
Output for 5.5.26
normal: 0.059736967086792 ternary: 0.05231499671936
Output for 5.5.25
normal: 0.039610862731934 ternary: 0.041821956634521
Output for 5.5.24
normal: 0.046406030654907 ternary: 0.042941093444824
Output for 5.4.45
normal: 0.052342891693115 ternary: 0.047693967819214
Output for 5.4.44
normal: 0.043889999389648 ternary: 0.043983936309814
Output for 5.4.43
normal: 0.058670997619629 ternary: 0.051032066345215
Output for 5.4.42
normal: 0.059866905212402 ternary: 0.052478075027466
Output for 5.4.41
normal: 0.058860063552856 ternary: 0.05078387260437
Output for 5.4.40
normal: 0.052032947540283 ternary: 0.052878141403198
Output for 5.4.39
normal: 0.040925979614258 ternary: 0.043894052505493
Output for 5.4.38
normal: 0.056621074676514 ternary: 0.050743103027344
Output for 5.4.37
normal: 0.052661895751953 ternary: 0.047478914260864
Output for 5.4.36
normal: 0.046941041946411 ternary: 0.049960851669312
Output for 5.4.35
normal: 0.040915012359619 ternary: 0.043843030929565
Output for 5.4.34
normal: 0.053746938705444 ternary: 0.048721075057983
Output for 5.4.32
normal: 0.051383972167969 ternary: 0.048174142837524
Output for 5.4.31
normal: 0.053766012191772 ternary: 0.04395580291748
Output for 5.4.30
normal: 0.054180145263672 ternary: 0.048190832138062
Output for 5.4.29
normal: 0.052079916000366 ternary: 0.045429944992065
Output for 5.4.28
normal: 0.045941114425659 ternary: 0.04393196105957
Output for 5.4.27
normal: 0.049581050872803 ternary: 0.052648067474365
Output for 5.4.26
normal: 0.054160118103027 ternary: 0.046551942825317
Output for 5.4.25
normal: 0.042943954467773 ternary: 0.043812036514282
Output for 5.4.24
normal: 0.056490898132324 ternary: 0.045169830322266
Output for 5.4.23
normal: 0.048577070236206 ternary: 0.049603939056396
Output for 5.4.22
normal: 0.051842927932739 ternary: 0.04626202583313
Output for 5.4.21
normal: 0.058375120162964 ternary: 0.051732063293457
Output for 5.4.20
normal: 0.057096004486084 ternary: 0.049721956253052
Output for 5.4.19
normal: 0.054474115371704 ternary: 0.04939603805542
Output for 5.4.18
normal: 0.058612108230591 ternary: 0.05030083656311
Output for 5.4.17
normal: 0.045054912567139 ternary: 0.044353008270264
Output for 5.4.16
normal: 0.053672790527344 ternary: 0.045295000076294
Output for 5.4.15
normal: 0.05891489982605 ternary: 0.05129599571228
Output for 5.4.14
normal: 0.057931900024414 ternary: 0.050379037857056
Output for 5.4.13
normal: 0.040884017944336 ternary: 0.043591976165771
Output for 5.4.12
normal: 0.044289112091064 ternary: 0.043856859207153
Output for 5.4.11
normal: 0.056211948394775 ternary: 0.049814939498901
Output for 5.4.10
normal: 0.057425975799561 ternary: 0.050452947616577
Output for 5.4.9
normal: 0.058838129043579 ternary: 0.051164150238037
Output for 5.4.8
normal: 0.05950403213501 ternary: 0.051278114318848
Output for 5.4.7
normal: 0.058921813964844 ternary: 0.051501035690308
Output for 5.4.6
normal: 0.049093008041382 ternary: 0.052103042602539
Output for 5.4.5
normal: 0.054532051086426 ternary: 0.052062034606934
Output for 5.4.4
normal: 0.040831089019775 ternary: 0.043815851211548
Output for 5.4.3
normal: 0.052444934844971 ternary: 0.046231031417847
Output for 5.4.2
normal: 0.061611890792847 ternary: 0.052413940429688
Output for 5.4.1
normal: 0.059623956680298 ternary: 0.045456886291504
Output for 5.4.0
normal: 0.055198192596436 ternary: 0.048818111419678
Output for 5.3.29
normal: 0.059359073638916 ternary: 0.061448812484741
Output for 5.3.28
normal: 0.069514036178589 ternary: 0.074090957641602
Output for 5.3.27
normal: 0.071587085723877 ternary: 0.063531875610352
Output for 5.3.26
normal: 0.072142124176025 ternary: 0.076004028320312
Output for 5.3.25
normal: 0.075988054275513 ternary: 0.079463958740234
Output for 5.3.24
normal: 0.079730987548828 ternary: 0.064961194992065
Output for 5.3.23
normal: 0.076851844787598 ternary: 0.061429977416992
Output for 5.3.22
normal: 0.06010103225708 ternary: 0.061415195465088
Output for 5.3.21
normal: 0.081109046936035 ternary: 0.064965009689331
Output for 5.3.20
normal: 0.069047927856445 ternary: 0.070778131484985
Output for 5.3.19
normal: 0.064388990402222 ternary: 0.065085172653198
Output for 5.3.18
normal: 0.079204082489014 ternary: 0.065183877944946
Output for 5.3.17
normal: 0.073847055435181 ternary: 0.065022945404053
Output for 5.3.16
normal: 0.080424070358276 ternary: 0.065889835357666
Output for 5.3.15
normal: 0.077831029891968 ternary: 0.066209077835083
Output for 5.3.14
normal: 0.075677156448364 ternary: 0.064256906509399
Output for 5.3.13
normal: 0.079527854919434 ternary: 0.068663120269775
Output for 5.3.12
normal: 0.085309028625488 ternary: 0.062830209732056
Output for 5.3.11
normal: 0.078989028930664 ternary: 0.077202796936035
Output for 5.3.10
normal: 0.075197219848633 ternary: 0.08105206489563
Output for 5.3.9
normal: 0.075559139251709 ternary: 0.068981885910034
Output for 5.3.8
normal: 0.072794198989868 ternary: 0.067038059234619
Output for 5.3.7
normal: 0.06224799156189 ternary: 0.066914081573486
Output for 5.3.6
normal: 0.07617712020874 ternary: 0.075926065444946
Output for 5.3.5
normal: 0.080065011978149 ternary: 0.06217098236084
Output for 5.3.4
normal: 0.079713106155396 ternary: 0.065190076828003
Output for 5.3.3
normal: 0.079843044281006 ternary: 0.06524395942688
Output for 5.3.2
normal: 0.075384140014648 ternary: 0.069783926010132
Output for 5.3.1
normal: 0.082828044891357 ternary: 0.065895795822144
Output for 5.3.0
normal: 0.078923940658569 ternary: 0.06755805015564
Output for 5.2.17
normal: 0.11385297775269 ternary: 0.090632915496826
Output for 5.2.16
normal: 0.10171914100647 ternary: 0.10091280937195
Output for 5.2.15
normal: 0.11964893341064 ternary: 0.089332103729248
Output for 5.2.14
normal: 0.084959983825684 ternary: 0.08670711517334
Output for 5.2.13
normal: 0.12151598930359 ternary: 0.0917649269104
Output for 5.2.12
normal: 0.08809494972229 ternary: 0.089709043502808
Output for 5.2.11
normal: 0.10320997238159 ternary: 0.10687899589539
Output for 5.2.10
normal: 0.085511922836304 ternary: 0.087802886962891
Output for 5.2.9
normal: 0.089695930480957 ternary: 0.093547105789185
Output for 5.2.8
normal: 0.086698770523071 ternary: 0.086117029190063
Output for 5.2.7
normal: 0.085248947143555 ternary: 0.086750984191895
Output for 5.2.6
normal: 0.083428859710693 ternary: 0.085896015167236
Output for 5.2.5
normal: 0.11130595207214 ternary: 0.11225008964539
Output for 5.2.4
normal: 0.087050914764404 ternary: 0.089359045028687
Output for 5.2.3
normal: 0.096831083297729 ternary: 0.098933935165405
Output for 5.2.2
normal: 0.085258007049561 ternary: 0.088682174682617
Output for 5.2.1
normal: 0.11626100540161 ternary: 0.081617116928101
Output for 5.2.0
normal: 0.11119484901428 ternary: 0.09123706817627
Output for 5.1.6
normal: 0.087561845779419 ternary: 0.089701175689697
Output for 5.1.5
normal: 0.12736892700195 ternary: 0.11760401725769
Output for 5.1.4
normal: 0.11926484107971 ternary: 0.094468832015991
Output for 5.1.3
normal: 0.1186101436615 ternary: 0.091468811035156
Output for 5.1.2
normal: 0.12393617630005 ternary: 0.092562198638916
Output for 5.1.1
normal: 0.11096501350403 ternary: 0.089744091033936
Output for 5.1.0
normal: 0.11760210990906 ternary: 0.09013295173645
Output for 5.0.5
normal: 0.32202291488647 ternary: 0.28872108459473
Output for 5.0.4
normal: 0.30282592773438 ternary: 0.27588105201721
Output for 5.0.3
normal: 0.33820104598999 ternary: 0.32814311981201
Output for 5.0.2
normal: 0.33493518829346 ternary: 0.29561805725098
Output for 5.0.1
normal: 0.27967810630798 ternary: 0.27703499794006
Output for 5.0.0
normal: 0.29909086227417 ternary: 0.27462887763977
Output for 4.4.9
normal: -0.710268 ternary: 0.291826
Output for 4.4.8
normal: -0.724267 ternary: 0.279754
Output for 4.4.7
normal: 0.319204 ternary: 0.302341
Output for 4.4.6
normal: -0.728349 ternary: 0.276409
Output for 4.4.5
normal: 0.272964 ternary: -0.723451
Output for 4.4.4
normal: 0.278793 ternary: 0.280811
Output for 4.4.3
normal: 0.308279 ternary: 0.281176
Output for 4.4.2
normal: 0.325976 ternary: 0.294661
Output for 4.4.1
normal: -0.670106 ternary: 0.282968
Output for 4.4.0
normal: 0.303602 ternary: 0.281888
Output for 4.3.11
normal: -0.677944 ternary: 0.288243
Output for 4.3.10
normal: 0.293491 ternary: 0.28726
Output for 4.3.9
normal: -0.673358 ternary: 0.280134
Output for 4.3.8
normal: -0.678414 ternary: 0.285248
Output for 4.3.7
normal: 0.273628 ternary: -0.728871
Output for 4.3.6
normal: 0.275278 ternary: -0.723491
Output for 4.3.5
normal: 0.342607 ternary: 0.33212
Output for 4.3.4
normal: -0.721395 ternary: 0.281431
Output for 4.3.3
normal: 0.273085 ternary: -0.725793
Output for 4.3.2
normal: 0.271212 ternary: 0.269639
Output for 4.3.1
normal: -0.701486 ternary: 0.28025
Output for 4.3.0
normal: 0.278298 ternary: -0.727246