3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = microtime(true); for($i = 1; $j = 1, $i <= 10000000; $i++){ ($i == $j); } $end = microtime(true); echo 'Not ternary: ', $end - $start, PHP_EOL; $start = microtime(true); for($i = 1; $j = 1, $i <= 10000000; $i++){ ($i == $j ? true : false); } $end = microtime(true); echo 'Ternary: ', $end - $start, PHP_EOL; ?>
Output for 7.1.0
Not ternary: -0.31600999832153 Ternary: -0.26020383834839
Output for 7.0.14
Not ternary: 0.079632997512817 Ternary: -0.2592031955719
Output for 7.0.10
Not ternary: 0.16121888160706 Ternary: 0.17331600189209
Output for 7.0.9
Not ternary: 0.17653799057007 Ternary: 0.16472911834717
Output for 7.0.8
Not ternary: 0.16976690292358 Ternary: 0.16522908210754
Output for 7.0.7
Not ternary: 0.17745494842529 Ternary: 0.16350078582764
Output for 7.0.6
Not ternary: 0.16328310966492 Ternary: 0.17068910598755
Output for 7.0.5
Not ternary: 0.17357707023621 Ternary: 0.16539311408997
Output for 7.0.4
Not ternary: 0.19664096832275 Ternary: 0.17714500427246
Output for 7.0.3
Not ternary: 0.2039520740509 Ternary: 0.17851686477661
Output for 7.0.2
Not ternary: 0.19252514839172 Ternary: 0.17365097999573
Output for 7.0.1
Not ternary: 0.18176817893982 Ternary: 0.1758770942688
Output for 7.0.0
Not ternary: 0.17414689064026 Ternary: 0.17704296112061
Output for hhvm-3.12.0
Not ternary: 0.94898390769958 Ternary: 1.0479800701141
Output for hhvm-3.10.0
Not ternary: 1.6333382129669
Process exited with code 137.
Output for 5.6.28
Not ternary: -0.14031410217285 Ternary: -0.47392606735229
Output for 5.6.25
Not ternary: 0.35038805007935 Ternary: 0.39413094520569
Output for 5.6.24
Not ternary: 0.33024096488953 Ternary: 0.3875789642334
Output for 5.6.23
Not ternary: 0.33551287651062 Ternary: 0.39802598953247
Output for 5.6.22
Not ternary: 0.34611201286316 Ternary: 0.40123915672302
Output for 5.6.21
Not ternary: 0.37070393562317 Ternary: 0.3944878578186
Output for 5.6.20
Not ternary: 0.34389495849609 Ternary: 0.38383007049561
Output for 5.6.19
Not ternary: 0.34962892532349 Ternary: 0.40014886856079
Output for 5.6.18
Not ternary: 0.34538602828979 Ternary: 0.39991307258606
Output for 5.6.17
Not ternary: 0.34240102767944 Ternary: 0.39888215065002
Output for 5.6.16
Not ternary: 0.33243703842163 Ternary: 0.39717507362366
Output for 5.6.15
Not ternary: 0.37985301017761 Ternary: 0.37859892845154
Output for 5.6.14
Not ternary: 0.35976004600525 Ternary: 0.41532182693481
Output for 5.6.13
Not ternary: 0.3827178478241 Ternary: 0.38195419311523
Output for 5.6.12
Not ternary: 0.34400796890259 Ternary: 0.40003705024719
Output for 5.6.11
Not ternary: 0.33856296539307 Ternary: 0.40396308898926
Output for 5.6.10
Not ternary: 0.34098410606384 Ternary: 0.39171314239502
Output for 5.6.9
Not ternary: 0.3027651309967 Ternary: 0.34785389900208
Output for 5.6.8
Not ternary: 0.30920815467834 Ternary: 0.33106780052185
Output for 5.6.7
Not ternary: 0.325767993927 Ternary: 0.41041398048401
Output for 5.6.6
Not ternary: 0.34590697288513 Ternary: 0.40183806419373
Output for 5.6.5
Not ternary: 0.36606502532959 Ternary: 0.40135884284973
Output for 5.6.4
Not ternary: 0.3591480255127 Ternary: 0.40153312683105
Output for 5.6.3
Not ternary: 0.34525299072266 Ternary: 0.40019798278809
Output for 5.6.2
Not ternary: 0.33984303474426 Ternary: 0.40106511116028
Output for 5.6.1
Not ternary: 0.34546995162964 Ternary: 0.40077495574951
Output for 5.6.0
Not ternary: 0.33418798446655 Ternary: 0.32828402519226
Output for 5.5.38
Not ternary: 0.38058304786682 Ternary: 0.42597508430481
Output for 5.5.37
Not ternary: 0.35539293289185 Ternary: 0.39338207244873
Output for 5.5.36
Not ternary: 0.32445907592773 Ternary: 0.3934280872345
Output for 5.5.35
Not ternary: 0.37637090682983 Ternary: 0.39771199226379
Output for 5.5.34
Not ternary: 0.34039688110352 Ternary: 0.4001739025116
Output for 5.5.33
Not ternary: 0.35688185691833 Ternary: 0.41066408157349
Output for 5.5.32
Not ternary: 0.3290638923645 Ternary: 0.34967303276062
Output for 5.5.31
Not ternary: 0.34353303909302 Ternary: 0.39913296699524
Output for 5.5.30
Not ternary: 0.36385107040405 Ternary: 0.39852786064148
Output for 5.5.29
Not ternary: 0.35696506500244 Ternary: 0.39835691452026
Output for 5.5.28
Not ternary: 0.34973001480103 Ternary: 0.41059279441833
Output for 5.5.27
Not ternary: 0.40092086791992 Ternary: 0.45413303375244
Output for 5.5.26
Not ternary: 0.32506513595581 Ternary: 0.39382910728455
Output for 5.5.25
Not ternary: 0.27747797966003 Ternary: 0.3289589881897
Output for 5.5.24
Not ternary: 0.33564114570618 Ternary: 0.4020299911499
Output for 5.5.23
Not ternary: 0.44550895690918 Ternary: 0.39182114601135
Output for 5.5.22
Not ternary: 0.32120013237 Ternary: 0.39594197273254
Output for 5.5.21
Not ternary: 0.34373497962952 Ternary: 0.39955902099609
Output for 5.5.20
Not ternary: 0.34134197235107 Ternary: 0.40022397041321
Output for 5.5.19
Not ternary: 0.31753897666931 Ternary: 0.39182209968567
Output for 5.5.18
Not ternary: 0.34801483154297 Ternary: 0.40040898323059
Output for 5.5.16
Not ternary: 0.36183905601501 Ternary: 0.4319109916687
Output for 5.5.15
Not ternary: 0.35481691360474 Ternary: 0.41327214241028
Output for 5.5.14
Not ternary: 0.35152101516724 Ternary: 0.39961695671082
Output for 5.5.13
Not ternary: 0.37878704071045 Ternary: 0.43591284751892
Output for 5.5.12
Not ternary: 0.34025096893311 Ternary: 0.4040858745575
Output for 5.5.11
Not ternary: 0.36292600631714 Ternary: 0.39841604232788
Output for 5.5.10
Not ternary: 0.35363793373108 Ternary: 0.40738391876221
Output for 5.5.9
Not ternary: 0.33673501014709 Ternary: 0.40011787414551
Output for 5.5.8
Not ternary: 0.34830784797668 Ternary: 0.40075397491455
Output for 5.5.7
Not ternary: 0.34659004211426 Ternary: 0.39794898033142
Output for 5.5.6
Not ternary: 0.34868311882019 Ternary: 0.40186285972595
Output for 5.5.5
Not ternary: 0.34694504737854 Ternary: 0.39812302589417
Output for 5.5.4
Not ternary: 0.36420297622681 Ternary: 0.40057992935181
Output for 5.5.3
Not ternary: 0.35332798957825 Ternary: 0.40112113952637
Output for 5.5.2
Not ternary: 0.34697103500366 Ternary: 0.39916110038757
Output for 5.5.1
Not ternary: 0.37426209449768 Ternary: 0.39722204208374
Output for 5.5.0
Not ternary: 0.30362510681152 Ternary: 0.34652996063232
Output for 5.4.45
Not ternary: 0.35036516189575 Ternary: 0.39884901046753
Output for 5.4.44
Not ternary: 0.39626312255859 Ternary: 0.44370698928833
Output for 5.4.43
Not ternary: 0.32891082763672 Ternary: 0.34424901008606
Output for 5.4.42
Not ternary: 0.35591888427734 Ternary: 0.3872377872467
Output for 5.4.41
Not ternary: 0.30633997917175 Ternary: 0.32829189300537
Output for 5.4.40
Not ternary: 0.34586310386658 Ternary: 0.40087413787842
Output for 5.4.39
Not ternary: 0.34523892402649 Ternary: 0.42523503303528
Output for 5.4.38
Not ternary: 0.34762597084045 Ternary: 0.39962601661682
Output for 5.4.37
Not ternary: 0.36675500869751 Ternary: 0.39826393127441
Output for 5.4.36
Not ternary: 0.32604503631592 Ternary: 0.38861799240112
Output for 5.4.35
Not ternary: 0.35260391235352 Ternary: 0.39787983894348
Output for 5.4.34
Not ternary: 0.34525585174561 Ternary: 0.43904399871826
Output for 5.4.32
Not ternary: 0.33051896095276 Ternary: 0.37517690658569
Output for 5.4.31
Not ternary: 0.33667898178101 Ternary: 0.38081693649292
Output for 5.4.30
Not ternary: 0.3473949432373 Ternary: 0.400062084198
Output for 5.4.29
Not ternary: 0.35317993164062 Ternary: 0.39617586135864
Output for 5.4.28
Not ternary: 0.33334398269653 Ternary: 0.39231896400452
Output for 5.4.27
Not ternary: 0.3309268951416 Ternary: 0.38877105712891
Output for 5.4.26
Not ternary: 0.36229300498962 Ternary: 0.40512704849243
Output for 5.4.25
Not ternary: 0.36308598518372 Ternary: 0.40118908882141
Output for 5.4.24
Not ternary: 0.34725093841553 Ternary: 0.39736390113831
Output for 5.4.23
Not ternary: 0.36406183242798 Ternary: 0.40870189666748
Output for 5.4.22
Not ternary: 0.35369300842285 Ternary: 0.39615488052368
Output for 5.4.21
Not ternary: 0.36954212188721 Ternary: 0.40787792205811
Output for 5.4.20
Not ternary: 0.35253691673279 Ternary: 0.39825987815857
Output for 5.4.19
Not ternary: 0.34799790382385 Ternary: 0.39972400665283
Output for 5.4.18
Not ternary: 0.35412096977234 Ternary: 0.39767479896545
Output for 5.4.17
Not ternary: 0.33381080627441 Ternary: 0.33828592300415
Output for 5.4.16
Not ternary: 0.3318920135498 Ternary: 0.38823294639587
Output for 5.4.15
Not ternary: 0.3274359703064 Ternary: 0.38015913963318
Output for 5.4.14
Not ternary: 0.33008599281311 Ternary: 0.33344316482544
Output for 5.4.13
Not ternary: 0.3115918636322 Ternary: 0.33832406997681
Output for 5.4.12
Not ternary: 0.34182691574097 Ternary: 0.39978504180908
Output for 5.4.11
Not ternary: 0.33994483947754 Ternary: 0.39821314811707
Output for 5.4.10
Not ternary: 0.34422087669373 Ternary: 0.5434901714325
Output for 5.4.9
Not ternary: 0.34176993370056 Ternary: 0.39721584320068
Output for 5.4.8
Not ternary: 0.3490149974823 Ternary: 0.40779185295105
Output for 5.4.7
Not ternary: 0.29166984558105 Ternary: 0.32833194732666
Output for 5.4.6
Not ternary: 0.30318403244019 Ternary: 0.32799005508423
Output for 5.4.5
Not ternary: 0.33736109733582 Ternary: 0.39766097068787
Output for 5.4.4
Not ternary: 0.35923004150391 Ternary: 0.39736604690552
Output for 5.4.3
Not ternary: 0.35136985778809 Ternary: 0.42393803596497
Output for 5.4.2
Not ternary: 0.3526930809021 Ternary: 0.39896202087402
Output for 5.4.1
Not ternary: 0.39861106872559 Ternary: 0.429692029953
Output for 5.4.0
Not ternary: 0.3197648525238 Ternary: 0.37103390693665
Output for 5.3.29
Not ternary: 0.60858798027039 Ternary: 0.47056484222412
Output for 5.3.28
Not ternary: 0.51487684249878 Ternary: 0.51925706863403
Output for 5.3.27
Not ternary: 0.47900915145874 Ternary: 0.51078009605408
Output for 5.3.26
Not ternary: 0.49891400337219 Ternary: 0.52871108055115
Output for 5.3.25
Not ternary: 0.47168779373169 Ternary: 0.49119400978088
Output for 5.3.24
Not ternary: 0.37564301490784 Ternary: 0.42880797386169
Output for 5.3.23
Not ternary: 0.45316481590271 Ternary: 0.58570909500122
Output for 5.3.22
Not ternary: 0.48695683479309 Ternary: 0.51389002799988
Output for 5.3.21
Not ternary: 0.51601195335388 Ternary: 0.54026198387146
Output for 5.3.20
Not ternary: 0.47626709938049 Ternary: 0.50007486343384
Output for 5.3.19
Not ternary: 0.49053597450256 Ternary: 0.51427698135376
Output for 5.3.18
Not ternary: 0.48588585853577 Ternary: 0.50250887870789
Output for 5.3.17
Not ternary: 0.49085807800293 Ternary: 0.50419092178345
Output for 5.3.16
Not ternary: 0.5055980682373 Ternary: 0.53370690345764
Output for 5.3.15
Not ternary: 0.49072504043579 Ternary: 0.50250792503357
Output for 5.3.14
Not ternary: 0.50409197807312 Ternary: 0.50539493560791
Output for 5.3.13
Not ternary: 0.4038679599762 Ternary: 0.45437383651733
Output for 5.3.12
Not ternary: 0.4604549407959 Ternary: 0.54259014129639
Output for 5.3.11
Not ternary: 0.49025297164917 Ternary: 0.5065860748291
Output for 5.3.10
Not ternary: 0.48159599304199 Ternary: 0.51704287528992
Output for 5.3.9
Not ternary: 0.50474119186401 Ternary: 0.53916120529175
Output for 5.3.8
Not ternary: 0.47390508651733 Ternary: 0.49565291404724
Output for 5.3.7
Not ternary: 0.47955012321472 Ternary: 0.52568411827087
Output for 5.3.6
Not ternary: 0.48284316062927 Ternary: 0.50165200233459
Output for 5.3.5
Not ternary: 0.45857000350952 Ternary: 0.52982783317566
Output for 5.3.4
Not ternary: 0.49364185333252 Ternary: 0.51450800895691
Output for 5.3.3
Not ternary: 0.51253986358643 Ternary: 0.51398110389709
Output for 5.3.2
Not ternary: 0.50428986549377 Ternary: 0.49448084831238
Output for 5.3.1
Not ternary: 0.49131202697754 Ternary: 0.51892495155334
Output for 5.3.0
Not ternary: 0.53894686698914 Ternary: 0.50541687011719
Output for 5.2.17
Not ternary: 0.71672010421753 Ternary: 0.65625095367432
Output for 5.2.16
Not ternary: 0.71244287490845 Ternary: 0.64478015899658
Output for 5.2.15
Not ternary: 0.70626878738403 Ternary: 0.66565704345703
Output for 5.2.14
Not ternary: 0.75668287277222 Ternary: 0.67187714576721
Output for 5.2.13
Not ternary: 0.61752390861511 Ternary: 0.65475988388062
Output for 5.2.12
Not ternary: 0.7487518787384 Ternary: 0.69207811355591
Output for 5.2.11
Not ternary: 0.73045897483826 Ternary: 0.68448090553284
Output for 5.2.10
Not ternary: 0.74848508834839 Ternary: 0.68986201286316
Output for 5.2.9
Not ternary: 0.65043902397156 Ternary: 0.6797981262207
Output for 5.2.8
Not ternary: 0.60266995429993 Ternary: 0.67688298225403
Output for 5.2.7
Not ternary: 0.59146404266357 Ternary: 0.66752696037292
Output for 5.2.6
Not ternary: 0.75730204582214 Ternary: 0.67951798439026
Output for 5.2.5
Not ternary: 0.75933504104614 Ternary: 0.68498516082764
Output for 5.2.4
Not ternary: 0.74340915679932 Ternary: 0.66516780853271
Output for 5.2.3
Not ternary: 0.72100400924683 Ternary: 0.81946706771851
Output for 5.2.2
Not ternary: 0.74089503288269 Ternary: 0.68736505508423
Output for 5.2.1
Not ternary: 0.65396690368652 Ternary: 0.62297677993774
Output for 5.2.0
Not ternary: 0.6329779624939 Ternary: 0.62595295906067
Output for 5.1.6
Not ternary: 0.60488390922546 Ternary: 0.70772409439087
Output for 5.1.5
Not ternary: 0.79623413085938 Ternary: 0.74255394935608
Output for 5.1.4
Not ternary: 0.81475901603699 Ternary: 0.74209189414978
Output for 5.1.3
Not ternary: 0.72554707527161 Ternary: 0.84578108787537
Output for 5.1.2
Not ternary: 0.77508020401001 Ternary: 0.8414249420166
Output for 5.1.1
Not ternary: 0.62426209449768 Ternary: 0.83058214187622
Output for 5.1.0
Not ternary: 0.63864302635193 Ternary: 0.81202387809753
Output for 5.0.5
Not ternary: 1.8900578022003
Process exited with code 137.
Output for 4.3.0 - 4.3.1, 4.3.4, 4.3.7, 4.3.9, 4.4.0, 4.4.2, 4.4.4 - 4.4.5, 4.4.9, 5.0.1 - 5.0.2, 5.0.4

Process exited with code 137.
Output for 5.0.3
Not ternary: 1.774337053299
Process exited with code 137.
Output for 5.0.0
Not ternary: 1.838828086853 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lch9o on line 10 PHP_EOL
Process exited with code 137.
Output for 4.4.8
Not ternary: 0.782422
Process exited with code 137.
Output for 4.4.7
Not ternary: 0.390863
Process exited with code 137.
Output for 4.4.6
Not ternary: 0.612451
Process exited with code 137.
Output for 4.4.3
Not ternary: 0.565563
Process exited with code 137.
Output for 4.4.1
Not ternary: 0.660249
Process exited with code 137.
Output for 4.3.11
Not ternary: 0.54383
Process exited with code 137.
Output for 4.3.10
Not ternary: 0.653308
Process exited with code 137.
Output for 4.3.8
Not ternary: 0.517667 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lch9o on line 10 PHP_EOL
Process exited with code 137.
Output for 4.3.6
Not ternary: 0.591482 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lch9o on line 10 PHP_EOL
Process exited with code 137.
Output for 4.3.5
Not ternary: 0.586472 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lch9o on line 10 PHP_EOL
Process exited with code 137.
Output for 4.3.3
Not ternary: 0.610088 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lch9o on line 10 PHP_EOL
Process exited with code 137.
Output for 4.3.2
Not ternary: 0.470951 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lch9o on line 10 PHP_EOL
Process exited with code 137.