3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $n=9999999; $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)."<br>\n"; $start=microtime(1); for($i=1;$i<=$n;$i++) { $c=($a!=$b)?($a+$b):8; } print 'ternary: '.(microtime(1)-$start)."<br>\n";
Output for 7.1.0
normal: 0.18475008010864<br> ternary: 0.17415404319763<br>
Output for 7.0.14
normal: 0.19804310798645<br> ternary: 0.17031717300415<br>
Output for 7.0.8
normal: 0.16841006278992<br> ternary: 0.17917799949646<br>
Output for 7.0.7
normal: 0.19688105583191<br> ternary: 0.17264008522034<br>
Output for 7.0.6
normal: 0.18686103820801<br> ternary: 0.16962003707886<br>
Output for 7.0.5
normal: 0.19874382019043<br> ternary: 0.17968511581421<br>
Output for 7.0.4
normal: 0.22383904457092<br> ternary: 0.19926905632019<br>
Output for 7.0.3
normal: 0.19196701049805<br> ternary: 0.19922304153442<br>
Output for 7.0.2
normal: 0.20547986030579<br> ternary: 0.17379879951477<br>
Output for 7.0.1
normal: 0.19588804244995<br> ternary: 0.18707895278931<br>
Output for 7.0.0
normal: 0.18529582023621<br> ternary: 0.18862009048462<br>
Output for 5.6.28
normal: 0.23423194885254<br> ternary: 0.7628219127655<br>
Output for 5.6.23
normal: 0.40979504585266<br> ternary: 0.36451601982117<br>
Output for 5.6.22
normal: 0.41721105575562<br> ternary: 0.36509895324707<br>
Output for 5.6.21
normal: 0.42406821250916<br> ternary: 0.42911291122437<br>
Output for 5.6.20
normal: 0.43938779830933<br> ternary: 0.44690012931824<br>
Output for 5.6.19
normal: 0.42119193077087<br> ternary: 0.42923808097839<br>
Output for 5.6.18
normal: 0.3787841796875<br> ternary: 0.3535749912262<br>
Output for 5.6.17
normal: 0.41713714599609<br> ternary: 0.40798187255859<br>
Output for 5.6.16
normal: 0.4537079334259<br> ternary: 0.4291410446167<br>
Output for 5.6.15
normal: 0.47732901573181<br> ternary: 0.43989086151123<br>
Output for 5.6.14
normal: 0.42767000198364<br> ternary: 0.42808294296265<br>
Output for 5.6.13
normal: 0.40663504600525<br> ternary: 0.35311102867126<br>
Output for 5.6.12
normal: 0.43448615074158<br> ternary: 0.43826007843018<br>
Output for 5.6.11
normal: 0.33562302589417<br> ternary: 0.35504293441772<br>
Output for 5.6.10
normal: 0.40561485290527<br> ternary: 0.35686588287354<br>
Output for 5.6.9
normal: 0.42090010643005<br> ternary: 0.4248948097229<br>
Output for 5.6.8
normal: 0.43310904502869<br> ternary: 0.42970204353333<br>
Output for 5.6.7
normal: 0.4350221157074<br> ternary: 0.41835403442383<br>
Output for 5.6.6
normal: 0.35052084922791<br> ternary: 0.35425400733948<br>
Output for 5.6.5
normal: 0.36705589294434<br> ternary: 0.3703510761261<br>
Output for 5.6.4
normal: 0.42094612121582<br> ternary: 0.4368679523468<br>
Output for 5.6.3
normal: 0.40915513038635<br> ternary: 0.39596581459045<br>
Output for 5.6.2
normal: 0.3544909954071<br> ternary: 0.35777497291565<br>
Output for 5.6.1
normal: 0.35155820846558<br> ternary: 0.35966205596924<br>
Output for 5.6.0
normal: 0.44643616676331<br> ternary: 0.42304396629333<br>
Output for 5.5.37
normal: 0.40953803062439<br> ternary: 0.39253401756287<br>
Output for 5.5.36
normal: 0.47734689712524<br> ternary: 0.46401596069336<br>
Output for 5.5.35
normal: 0.42860794067383<br> ternary: 0.42847681045532<br>
Output for 5.5.34
normal: 0.43577599525452<br> ternary: 0.4161901473999<br>
Output for 5.5.33
normal: 0.44301104545593<br> ternary: 0.42939901351929<br>
Output for 5.5.32
normal: 0.42082285881042<br> ternary: 0.42496490478516<br>
Output for 5.5.31
normal: 0.42228817939758<br> ternary: 0.43973398208618<br>
Output for 5.5.30
normal: 0.41488718986511<br> ternary: 0.40838885307312<br>
Output for 5.5.29
normal: 0.43031597137451<br> ternary: 0.43355989456177<br>
Output for 5.5.28
normal: 0.35102200508118<br> ternary: 0.35352683067322<br>
Output for 5.5.27
normal: 0.42258501052856<br> ternary: 0.44509983062744<br>
Output for 5.5.26
normal: 0.42605400085449<br> ternary: 0.43096518516541<br>
Output for 5.5.25
normal: 0.33915901184082<br> ternary: 0.35567212104797<br>
Output for 5.5.24
normal: 0.44973683357239<br> ternary: 0.43575716018677<br>
Output for 5.5.23
normal: 0.41848015785217<br> ternary: 0.41842007637024<br>
Output for 5.5.22
normal: 0.34094381332397<br> ternary: 0.35540914535522<br>
Output for 5.5.21
normal: 0.36358618736267<br> ternary: 0.3946328163147<br>
Output for 5.5.20
normal: 0.38913202285767<br> ternary: 0.38071393966675<br>
Output for 5.5.19
normal: 0.43947696685791<br> ternary: 0.44501900672913<br>
Output for 5.5.18
normal: 0.35901594161987<br> ternary: 0.35289096832275<br>
Output for 5.5.16
normal: 0.34174394607544<br> ternary: 0.35608315467834<br>
Output for 5.5.15
normal: 0.33999085426331<br> ternary: 0.35751986503601<br>
Output for 5.5.14
normal: 0.44395589828491<br> ternary: 0.42803406715393<br>
Output for 5.5.13
normal: 0.44350790977478<br> ternary: 0.44752597808838<br>
Output for 5.5.12
normal: 0.4224328994751<br> ternary: 0.42046809196472<br>
Output for 5.5.11
normal: 0.33800601959229<br> ternary: 0.38867807388306<br>
Output for 5.5.10
normal: 0.43319582939148<br> ternary: 0.42223501205444<br>
Output for 5.5.9
normal: 0.47974705696106<br> ternary: 0.40704393386841<br>
Output for 5.5.8
normal: 0.45439195632935<br> ternary: 0.44970798492432<br>
Output for 5.5.7
normal: 0.44277000427246<br> ternary: 0.42452001571655<br>
Output for 5.5.6
normal: 0.42466402053833<br> ternary: 0.44131994247437<br>
Output for 5.5.5
normal: 0.42796301841736<br> ternary: 0.42803502082825<br>
Output for 5.5.4
normal: 0.42374897003174<br> ternary: 0.4211950302124<br>
Output for 5.5.3
normal: 0.4396870136261<br> ternary: 0.43104481697083<br>
Output for 5.5.2
normal: 0.42896914482117<br> ternary: 0.43164491653442<br>
Output for 5.5.1
normal: 0.3549919128418<br> ternary: 0.38120913505554<br>
Output for 5.5.0
normal: 0.41835188865662<br> ternary: 0.40533900260925<br>
Output for 5.4.45
normal: 0.44220900535583<br> ternary: 0.43837809562683<br>
Output for 5.4.44
normal: 0.42355799674988<br> ternary: 0.43592691421509<br>
Output for 5.4.43
normal: 0.43459415435791<br> ternary: 0.43989706039429<br>
Output for 5.4.42
normal: 0.42036604881287<br> ternary: 0.42580008506775<br>
Output for 5.4.41
normal: 0.41821813583374<br> ternary: 0.41432189941406<br>
Output for 5.4.40
normal: 0.38273596763611<br> ternary: 0.3862578868866<br>
Output for 5.4.39
normal: 0.42069602012634<br> ternary: 0.43594098091125<br>
Output for 5.4.38
normal: 0.41798806190491<br> ternary: 0.42848610877991<br>
Output for 5.4.37
normal: 0.50420594215393<br> ternary: 0.49596405029297<br>
Output for 5.4.36
normal: 0.36777901649475<br> ternary: 0.36132597923279<br>
Output for 5.4.35
normal: 0.42651104927063<br> ternary: 0.43914604187012<br>
Output for 5.4.34
normal: 0.35539793968201<br> ternary: 0.37804698944092<br>
Output for 5.4.32
normal: 0.35034418106079<br> ternary: 0.36433792114258<br>
Output for 5.4.31
normal: 0.42152094841003<br> ternary: 0.41187500953674<br>
Output for 5.4.30
normal: 0.43301892280579<br> ternary: 0.43426990509033<br>
Output for 5.4.29
normal: 0.44664978981018<br> ternary: 0.43758606910706<br>
Output for 5.4.28
normal: 0.44097805023193<br> ternary: 0.43987607955933<br>
Output for 5.4.27
normal: 0.42358708381653<br> ternary: 0.42885494232178<br>
Output for 5.4.26
normal: 0.43573689460754<br> ternary: 0.44023013114929<br>
Output for 5.4.25
normal: 0.4110119342804<br> ternary: 0.3771288394928<br>
Output for 5.4.24
normal: 0.38672709465027<br> ternary: 0.38662195205688<br>
Output for 5.4.23
normal: 0.47344279289246<br> ternary: 0.42440414428711<br>
Output for 5.4.22
normal: 0.34739995002747<br> ternary: 0.36113500595093<br>
Output for 5.4.21
normal: 0.44408488273621<br> ternary: 0.44667911529541<br>
Output for 5.4.20
normal: 0.42075800895691<br> ternary: 0.41525983810425<br>
Output for 5.4.19
normal: 0.49585914611816<br> ternary: 0.44681596755981<br>
Output for 5.4.18
normal: 0.4132399559021<br> ternary: 0.40933299064636<br>
Output for 5.4.17
normal: 0.4221248626709<br> ternary: 0.43202996253967<br>
Output for 5.4.16
normal: 0.41602182388306<br> ternary: 0.41877102851868<br>
Output for 5.4.15
normal: 0.43299794197083<br> ternary: 0.42979502677917<br>
Output for 5.4.14
normal: 0.3504490852356<br> ternary: 0.37449312210083<br>
Output for 5.4.13
normal: 0.42724585533142<br> ternary: 0.43696403503418<br>
Output for 5.4.12
normal: 0.44326901435852<br> ternary: 0.43526697158813<br>
Output for 5.4.11
normal: 0.41652011871338<br> ternary: 0.42222380638123<br>
Output for 5.4.10
normal: 0.40970087051392<br> ternary: 0.39862608909607<br>
Output for 5.4.9
normal: 0.37725901603699<br> ternary: 0.40266489982605<br>
Output for 5.4.8
normal: 0.47530102729797<br> ternary: 0.46972298622131<br>
Output for 5.4.7
normal: 0.39718198776245<br> ternary: 0.36634397506714<br>
Output for 5.4.6
normal: 0.42093515396118<br> ternary: 0.41541290283203<br>
Output for 5.4.5
normal: 0.44857406616211<br> ternary: 0.43888902664185<br>
Output for 5.4.4
normal: 0.43883180618286<br> ternary: 0.44763994216919<br>
Output for 5.4.3
normal: 0.44589900970459<br> ternary: 0.44215703010559<br>
Output for 5.4.2
normal: 0.41952800750732<br> ternary: 0.42642307281494<br>
Output for 5.4.1
normal: 0.38268303871155<br> ternary: 0.36049294471741<br>
Output for 5.4.0
normal: 0.4665789604187<br> ternary: 0.47291803359985<br>
Output for 5.3.29
normal: 0.60338807106018<br> ternary: 0.56709790229797<br>
Output for 5.3.28
normal: 0.59297490119934<br> ternary: 0.55121684074402<br>
Output for 5.3.27
normal: 0.58976602554321<br> ternary: 0.52362608909607<br>
Output for 5.3.26
normal: 0.50681495666504<br> ternary: 0.50658082962036<br>
Output for 5.3.25
normal: 0.47282314300537<br> ternary: 0.49846196174622<br>
Output for 5.3.24
normal: 0.53923511505127<br> ternary: 0.49722003936768<br>
Output for 5.3.23
normal: 0.46700811386108<br> ternary: 0.49473810195923<br>
Output for 5.3.22
normal: 0.51245903968811<br> ternary: 0.54929995536804<br>
Output for 5.3.21
normal: 0.47598910331726<br> ternary: 0.51897501945496<br>
Output for 5.3.20
normal: 0.53379011154175<br> ternary: 0.51919507980347<br>
Output for 5.3.19
normal: 0.59029006958008<br> ternary: 0.5597550868988<br>
Output for 5.3.18
normal: 0.47639608383179<br> ternary: 0.50714612007141<br>
Output for 5.3.17
normal: 0.54093718528748<br> ternary: 0.52614402770996<br>
Output for 5.3.16
normal: 0.62208795547485<br> ternary: 0.54002714157104<br>
Output for 5.3.15
normal: 0.62523078918457<br> ternary: 0.57455992698669<br>
Output for 5.3.14
normal: 0.63015913963318<br> ternary: 0.57991695404053<br>
Output for 5.3.13
normal: 0.63246297836304<br> ternary: 0.55533289909363<br>
Output for 5.3.12
normal: 0.64293789863586<br> ternary: 0.62976503372192<br>
Output for 5.3.11
normal: 0.49430012702942<br> ternary: 0.52089500427246<br>
Output for 5.3.10
normal: 0.50163722038269<br> ternary: 0.50830388069153<br>
Output for 5.3.9
normal: 0.82971692085266<br> ternary: 0.60646891593933<br>
Output for 5.3.8
normal: 0.48193597793579<br> ternary: 0.5586359500885<br>
Output for 5.3.7
normal: 0.55167818069458<br> ternary: 0.52499508857727<br>
Output for 5.3.6
normal: 0.51433897018433<br> ternary: 0.54964804649353<br>
Output for 5.3.5
normal: 0.5369279384613<br> ternary: 0.58304786682129<br>
Output for 5.3.4
normal: 0.62665390968323<br> ternary: 0.58292293548584<br>
Output for 5.3.3
normal: 0.59508299827576<br> ternary: 0.55539679527283<br>
Output for 5.3.2
normal: 0.60910797119141<br> ternary: 0.59492301940918<br>
Output for 5.3.1
normal: 0.4988329410553<br> ternary: 0.52854681015015<br>
Output for 5.3.0
normal: 0.55023694038391<br> ternary: 0.5191650390625<br>
Output for 5.2.17
normal: 0.87842988967896<br> ternary: 0.73151397705078<br>
Output for 5.2.16
normal: 0.78448104858398<br> ternary: 0.84104681015015<br>
Output for 5.2.15
normal: 0.83291411399841<br> ternary: 0.84612703323364<br>
Output for 5.2.14
normal: 0.76821994781494<br> ternary: 0.77251315116882<br>
Output for 5.2.13
normal: 0.72662997245789<br> ternary: 0.73320984840393<br>
Output for 5.2.12
normal: 0.74230885505676<br> ternary: 0.73093700408936<br>
Output for 5.2.11
normal: 0.8972499370575<br> ternary: 0.74287891387939<br>
Output for 5.2.10
normal: 0.82360291481018<br> ternary: 0.78812694549561<br>
Output for 5.2.9
normal: 0.82351899147034<br> ternary: 0.83788299560547<br>
Output for 5.2.8
normal: 0.79156398773193<br> ternary: 0.77317404747009<br>
Output for 5.2.7
normal: 0.83620810508728<br> ternary: 0.76257610321045<br>
Output for 5.2.6
normal: 0.75944685935974<br> ternary: 0.73730397224426<br>
Output for 5.2.5
normal: 0.84353995323181<br> ternary: 0.74066710472107<br>
Output for 5.2.4
normal: 0.89788603782654<br> ternary: 0.75760102272034<br>
Output for 5.2.3
normal: 0.74871802330017<br> ternary: 0.76049304008484<br>
Output for 5.2.2
normal: 0.72504186630249<br> ternary: 0.75702619552612<br>
Output for 5.2.1
normal: 0.69196701049805<br> ternary: 0.67042899131775<br>
Output for 5.2.0
normal: 0.8856418132782<br> ternary: 0.74836707115173<br>
Output for 5.1.6
normal: 0.74153900146484<br> ternary: 0.76433300971985<br>
Output for 5.1.5
normal: 0.96178698539734<br> ternary: 0.79185891151428<br>
Output for 5.1.4
normal: 0.77400803565979<br> ternary: 0.76023101806641<br>
Output for 5.1.3
normal: 0.93492889404297<br> ternary: 0.75105285644531<br>
Output for 5.1.2
normal: 0.92384600639343<br> ternary: 0.85066509246826<br>
Output for 5.1.1
normal: 0.8969099521637<br> ternary: 0.74427914619446<br>
Output for 5.1.0
normal: 0.91437482833862<br> ternary: 0.77543592453003<br>
Output for 4.3.0 - 4.3.8, 4.3.10 - 4.4.0, 4.4.2 - 5.0.0, 5.0.2 - 5.0.5

Process exited with code 137.
Output for 5.0.1
normal: 2.1849708557129<br>
Process exited with code 137.
Output for 4.4.1
normal: 0.456015<br>
Process exited with code 137.
Output for 4.3.9
normal: 0.279825<br>
Process exited with code 137.