3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function absolute(&$n){ return ((($n >> 31) ^ $n) - ($n >> 31)); } $start = microtime(true); for($i = 0; $i <= 5000000; $i++){ absolute($y); } $end = microtime(true); echo 'absolute: ' . ($end - $start); echo "\n"; $start = microtime(true); for($i = 0; $i <= 5000000; $i++){ abs($y); } $end = microtime(true); echo 'abs ' . ($end - $start);
Output for 7.1.0
absolute: 0.040922164916992 abs -0.11117792129517
Output for 7.0.14
absolute: 0.34766888618469 abs -0.12936902046204
Output for 7.0.10
absolute: 0.27584004402161 abs 0.11264991760254
Output for 7.0.9
absolute: 0.24399709701538 abs 0.089930057525635
Output for 7.0.8
absolute: 0.22979116439819 abs 0.099209785461426
Output for 7.0.7
absolute: 0.22010207176208 abs 0.092139959335327
Output for 7.0.6
absolute: 0.29257607460022 abs 0.12715196609497
Output for 7.0.5
absolute: 0.26249217987061 abs 0.12708497047424
Output for 7.0.4
absolute: 0.27450299263 abs 0.11550498008728
Output for 7.0.3
absolute: 0.28354811668396 abs 0.11712193489075
Output for 7.0.2
absolute: 0.28326511383057 abs 0.11694884300232
Output for 7.0.1
absolute: 0.26667094230652 abs 0.11367702484131
Output for 7.0.0
absolute: 0.28852510452271 abs 0.12272095680237
Output for 5.6.28
absolute: -0.40962600708008 abs 1.5398399829865
Output for 5.6.25
absolute: 0.51482605934143 abs 0.40392994880676
Output for 5.6.24
absolute: 0.52121996879578 abs 0.440505027771
Output for 5.6.23
absolute: 0.41003584861755 abs 0.35416603088379
Output for 5.6.22
absolute: 0.41989207267761 abs 0.34132099151611
Output for 5.6.21
absolute: 0.51766204833984 abs 0.42320895195007
Output for 5.6.20
absolute: 0.52129101753235 abs 0.42655205726624
Output for 5.6.19
absolute: 0.5326771736145 abs 0.42543816566467
Output for 5.6.18
absolute: 0.53172302246094 abs 0.42911386489868
Output for 5.6.17
absolute: 0.49547386169434 abs 0.46247506141663
Output for 5.6.16
absolute: 0.51039814949036 abs 0.38620686531067
Output for 5.6.15
absolute: 0.51825499534607 abs 0.41601490974426
Output for 5.6.14
absolute: 0.54285788536072 abs 0.4286150932312
Output for 5.6.13
absolute: 0.45750403404236 abs 0.35425019264221
Output for 5.6.12
absolute: 0.49294209480286 abs 0.43897795677185
Output for 5.6.11
absolute: 0.53870391845703 abs 0.42352986335754
Output for 5.6.10
absolute: 0.53003311157227 abs 0.40455603599548
Output for 5.6.9
absolute: 0.59567809104919 abs 0.40754103660583
Output for 5.6.8
absolute: 0.48815083503723 abs 0.50470089912415
Output for 5.6.7
absolute: 0.56630516052246 abs 0.48040986061096
Output for 5.6.6
absolute: 0.47096991539001 abs 0.35047602653503
Output for 5.6.5
absolute: 0.5096709728241 abs 0.411700963974
Output for 5.6.4
absolute: 0.42171788215637 abs 0.34857106208801
Output for 5.6.3
absolute: 0.46902990341187 abs 0.35130095481873
Output for 5.6.2
absolute: 0.41711711883545 abs 0.34243297576904
Output for 5.6.1
absolute: 0.50711917877197 abs 0.39427590370178
Output for 5.6.0
absolute: 0.50509309768677 abs 0.44185781478882
Output for 5.5.38
absolute: 0.50191187858582 abs 0.41932892799377
Output for 5.5.37
absolute: 0.40232682228088 abs 0.36290907859802
Output for 5.5.36
absolute: 0.39534497261047 abs 0.356938123703
Output for 5.5.35
absolute: 0.50430703163147 abs 0.384281873703
Output for 5.5.34
absolute: 0.59796690940857 abs 0.42549014091492
Output for 5.5.33
absolute: 0.51904988288879 abs 0.43717408180237
Output for 5.5.32
absolute: 0.51351189613342 abs 0.39968299865723
Output for 5.5.31
absolute: 0.54738092422485 abs 0.43244409561157
Output for 5.5.30
absolute: 0.54608201980591 abs 0.44591116905212
Output for 5.5.29
absolute: 0.45503902435303 abs 0.41380310058594
Output for 5.5.28
absolute: 0.52288317680359 abs 0.42825102806091
Output for 5.5.27
absolute: 0.51078605651855 abs 0.422856092453
Output for 5.5.26
absolute: 0.4968478679657 abs 0.38821196556091
Output for 5.5.25
absolute: 0.46777606010437 abs 0.41220903396606
Output for 5.5.24
absolute: 0.53367686271667 abs 0.44009304046631
Output for 5.5.23
absolute: 0.52531003952026 abs 0.43203282356262
Output for 5.5.22
absolute: 0.48874306678772 abs 0.3941969871521
Output for 5.5.21
absolute: 0.52305293083191 abs 0.46578001976013
Output for 5.5.20
absolute: 0.39484405517578 abs 0.3479208946228
Output for 5.5.19
absolute: 0.39919281005859 abs 0.3589301109314
Output for 5.5.18
absolute: 0.40886998176575 abs 0.35566997528076
Output for 5.5.16
absolute: 0.51250696182251 abs 0.47323703765869
Output for 5.5.15
absolute: 0.50870203971863 abs 0.43276405334473
Output for 5.5.14
absolute: 0.49793601036072 abs 0.41413998603821
Output for 5.5.13
absolute: 0.52508497238159 abs 0.43246793746948
Output for 5.5.12
absolute: 0.44569706916809 abs 0.39337086677551
Output for 5.5.11
absolute: 0.44446492195129 abs 0.39922308921814
Output for 5.5.10
absolute: 0.53305602073669 abs 0.44398403167725
Output for 5.5.9
absolute: 0.5407509803772 abs 0.42842197418213
Output for 5.5.8
absolute: 0.52057600021362 abs 0.39449095726013
Output for 5.5.7
absolute: 0.506676197052 abs 0.43552494049072
Output for 5.5.6
absolute: 0.50691890716553 abs 0.43345594406128
Output for 5.5.5
absolute: 0.497633934021 abs 0.42598295211792
Output for 5.5.4
absolute: 0.41758918762207 abs 0.35900902748108
Output for 5.5.3
absolute: 0.52555418014526 abs 0.44546604156494
Output for 5.5.2
absolute: 0.51920104026794 abs 0.43792819976807
Output for 5.5.1
absolute: 0.54102683067322 abs 0.39515805244446
Output for 5.5.0
absolute: 0.51257681846619 abs 0.4087347984314
Output for 5.4.45
absolute: 0.48336505889893 abs 0.37723708152771
Output for 5.4.44
absolute: 0.50344514846802 abs 0.49373006820679
Output for 5.4.43
absolute: 0.49594807624817 abs 0.41105389595032
Output for 5.4.42
absolute: 0.5542631149292 abs 0.42375516891479
Output for 5.4.41
absolute: 0.51807594299316 abs 0.4261531829834
Output for 5.4.40
absolute: 0.49649381637573 abs 0.4016010761261
Output for 5.4.39
absolute: 0.51574397087097 abs 0.43701314926147
Output for 5.4.38
absolute: 0.46552181243896 abs 0.40060806274414
Output for 5.4.37
absolute: 0.51237893104553 abs 0.39626908302307
Output for 5.4.36
absolute: 0.4310610294342 abs 0.36264705657959
Output for 5.4.35
absolute: 0.44505381584167 abs 0.36089396476746
Output for 5.4.34
absolute: 0.40422797203064 abs 0.36835503578186
Output for 5.4.32
absolute: 0.49298310279846 abs 0.3924548625946
Output for 5.4.31
absolute: 0.49828910827637 abs 0.40823101997375
Output for 5.4.30
absolute: 0.51612710952759 abs 0.4296088218689
Output for 5.4.29
absolute: 0.43967390060425 abs 0.41278290748596
Output for 5.4.28
absolute: 0.4594578742981 abs 0.42686009407043
Output for 5.4.27
absolute: 0.53878998756409 abs 0.42904305458069
Output for 5.4.26
absolute: 0.48982119560242 abs 0.52580499649048
Output for 5.4.25
absolute: 0.50675797462463 abs 0.42478489875793
Output for 5.4.24
absolute: 0.50861811637878 abs 0.44461989402771
Output for 5.4.23
absolute: 0.4384548664093 abs 0.37540984153748
Output for 5.4.22
absolute: 0.50025081634521 abs 0.42573213577271
Output for 5.4.21
absolute: 0.48353099822998 abs 0.43099689483643
Output for 5.4.20
absolute: 0.49827289581299 abs 0.41478610038757
Output for 5.4.19
absolute: 0.48779511451721 abs 0.41358709335327
Output for 5.4.18
absolute: 0.45118808746338 abs 0.44003295898438
Output for 5.4.17
absolute: 0.45547699928284 abs 0.39133715629578
Output for 5.4.16
absolute: 0.45409393310547 abs 0.47228813171387
Output for 5.4.15
absolute: 0.50507807731628 abs 0.4198911190033
Output for 5.4.14
absolute: 0.56371903419495 abs 0.44505405426025
Output for 5.4.13
absolute: 0.52685904502869 abs 0.43456196784973
Output for 5.4.12
absolute: 0.47107100486755 abs 0.41058897972107
Output for 5.4.11
absolute: 0.40025615692139 abs 0.36674189567566
Output for 5.4.10
absolute: 0.4327290058136 abs 0.36200904846191
Output for 5.4.9
absolute: 0.48442888259888 abs 0.36377215385437
Output for 5.4.8
absolute: 0.57760500907898 abs 0.39293694496155
Output for 5.4.7
absolute: 0.46501183509827 abs 0.46008586883545
Output for 5.4.6
absolute: 0.48470306396484 abs 0.3673050403595
Output for 5.4.5
absolute: 0.39395809173584 abs 0.35548090934753
Output for 5.4.4
absolute: 0.46346807479858 abs 0.35511112213135
Output for 5.4.3
absolute: 0.50566482543945 abs 0.3954291343689
Output for 5.4.2
absolute: 0.40262293815613 abs 0.36028814315796
Output for 5.4.1
absolute: 0.56308484077454 abs 0.42015314102173
Output for 5.4.0
absolute: 0.40817594528198 abs 0.35427904129028
Output for 5.3.29
absolute: 0.89573311805725 abs 0.43148112297058
Output for 5.3.28
absolute: 0.87645387649536 abs 0.47853493690491
Output for 5.3.27
absolute: 0.89516401290894 abs 0.45751404762268
Output for 5.3.26
absolute: 0.85098004341125 abs 0.43211984634399
Output for 5.3.25
absolute: 0.89286398887634 abs 0.43935394287109
Output for 5.3.24
absolute: 0.8858060836792 abs 0.43747401237488
Output for 5.3.23
absolute: 0.91163015365601 abs 0.4403829574585
Output for 5.3.22
absolute: 0.79518795013428 abs 0.43427085876465
Output for 5.3.21
absolute: 0.79007697105408 abs 0.44439888000488
Output for 5.3.20
absolute: 0.73226284980774 abs 0.44217801094055
Output for 5.3.19
absolute: 0.88928198814392 abs 0.50090098381042
Output for 5.3.18
absolute: 0.91771697998047 abs 0.44275903701782
Output for 5.3.17
absolute: 0.78888607025146 abs 0.43790888786316
Output for 5.3.16
absolute: 0.8991539478302 abs 0.44598603248596
Output for 5.3.15
absolute: 0.88736510276794 abs 0.44722318649292
Output for 5.3.14
absolute: 0.94331407546997 abs 0.44308185577393
Output for 5.3.13
absolute: 0.90110802650452 abs 0.43475604057312
Output for 5.3.12
absolute: 0.85982203483582 abs 0.43832993507385
Output for 5.3.11
absolute: 0.83666110038757 abs 0.49632382392883
Output for 5.3.10
absolute: 0.72951483726501 abs 0.45125794410706
Output for 5.3.9
absolute: 0.84846782684326 abs 0.44043588638306
Output for 5.3.8
absolute: 0.79285097122192 abs 0.43325614929199
Output for 5.3.7
absolute: 0.8530650138855 abs 0.45880198478699
Output for 5.3.6
absolute: 0.90394186973572 abs 0.45177984237671
Output for 5.3.5
absolute: 0.8974130153656 abs 0.44705891609192
Output for 5.3.4
absolute: 0.92164301872253 abs 0.45375394821167
Output for 5.3.3
absolute: 0.91250896453857 abs 0.44904899597168
Output for 5.3.2
absolute: 0.97640609741211 abs 0.53285002708435
Output for 5.3.1
absolute: 0.90296602249146 abs 0.43740797042847
Output for 5.3.0
absolute: 0.92432308197021 abs 0.45236110687256
Output for 5.2.17
absolute: 1.1801309585571 abs 0.46321296691895
Output for 5.2.16
absolute: 1.1933619976044 abs 0.46053290367126
Output for 5.2.15
absolute: 1.1474080085754 abs 0.45622396469116
Output for 5.2.14
absolute: 1.2912030220032 abs 0.48863792419434
Output for 5.2.13
absolute: 1.1933119297028 abs 0.44637393951416
Output for 5.2.12
absolute: 1.2481889724731 abs 0.45342898368835
Output for 5.2.11
absolute: 1.2369360923767 abs 0.48464202880859
Output for 5.2.10
absolute: 1.113853931427 abs 0.49949479103088
Output for 5.2.9
absolute: 1.0250148773193 abs 0.48921513557434
Output for 5.2.8
absolute: 1.0947470664978 abs 0.50301814079285
Output for 5.2.7
absolute: 1.1607959270477 abs 0.56287002563477
Output for 5.2.6
absolute: 1.1451711654663 abs 0.46016883850098
Output for 5.2.5
absolute: 1.0295858383179 abs 0.46173000335693
Output for 5.2.4
absolute: 1.1284439563751 abs 0.44950318336487
Output for 5.2.3
absolute: 1.2355329990387 abs 0.44607400894165
Output for 5.2.2
absolute: 1.1154010295868 abs 0.50617003440857
Output for 5.2.1
absolute: 1.105761051178 abs 0.52480888366699
Output for 5.2.0
absolute: 1.1537809371948 abs 0.43742299079895
Output for 5.1.6
absolute: 1.2146408557892 abs 0.44863986968994
Output for 5.1.5
absolute: 1.0422229766846 abs 0.42914891242981
Output for 5.1.4
absolute: 1.1732649803162 abs 0.47328495979309
Output for 5.1.3
absolute: 0.97910308837891 abs 0.45330691337585
Output for 5.1.2
absolute: 1.1582009792328 abs 0.42269492149353
Output for 5.1.1
absolute: 1.1447820663452 abs 0.42444705963135
Output for 5.1.0
absolute: 1.1832680702209 abs 0.42764091491699
Output for 4.3.1 - 4.3.2, 4.3.4 - 4.3.5, 4.3.7 - 4.3.8, 4.4.2, 4.4.4, 4.4.7 - 4.4.9, 5.0.2, 5.0.4 - 5.0.5

Process exited with code 137.
Output for 5.0.3
absolute: 1.8566558361053
Process exited with code 137.
Output for 5.0.1
absolute: 1.9529399871826
Process exited with code 137.
Output for 5.0.0
absolute: 2.2687020301819
Process exited with code 137.
Output for 4.4.6
absolute: 0.802098
Process exited with code 137.
Output for 4.4.5
absolute: 0.963201
Process exited with code 137.
Output for 4.4.3
absolute: 0.949669
Process exited with code 137.
Output for 4.4.1
absolute: 0.071377
Process exited with code 137.
Output for 4.4.0
absolute: 0.992964
Process exited with code 137.
Output for 4.3.11
absolute: 0.966357
Process exited with code 137.
Output for 4.3.10
absolute: 0.820525
Process exited with code 137.
Output for 4.3.9
absolute: 0.921647
Process exited with code 137.
Output for 4.3.6
absolute: 0.051975
Process exited with code 137.
Output for 4.3.3
absolute: 0.872117
Process exited with code 137.
Output for 4.3.0
absolute: 0.965893
Process exited with code 137.