3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (!function_exists('array_column')) { function array_column($input, $column_key, $index_key = null) { if ($index_key !== null) { // Collect the keys $keys = array(); $i = 0; // Counter for numerical keys when key does not exist foreach ($input as $row) { if (array_key_exists($index_key, $row)) { // Update counter for numerical keys if (is_numeric($row[$index_key]) || is_bool($row[$index_key])) { $i = max($i, (int) $row[$index_key] + 1); } // Get the key from a single column of the array $keys[] = $row[$index_key]; } else { // The key does not exist, use numerical indexing $keys[] = $i++; } } } if ($column_key !== null) { // Collect the values $values = array(); $i = 0; // Counter for removing keys foreach ($input as $row) { if (array_key_exists($column_key, $row)) { // Get the values from a single column of the input array $values[] = $row[$column_key]; $i++; } elseif (isset($keys)) { // Values does not exist, also drop the key for it array_splice($keys, $i, 1); } } } else { // Get the full arrays $values = array_values($input); } if ($index_key !== null) { return array_combine($keys, $values); } return $values; } echo "Custom array_column()"; } $start = microtime(true); for ($i=0;$i<9999;$i++) { fmod(34, 4294967296); } $end = microtime(true); echo $end-$start."\n"; $start = microtime(true); for ($i=0;$i<9999;$i++) { bcmod('34', '4294967296'); } $end = microtime(true); echo $end-$start."\n";
Output for 7.1.0
0.0005650520324707 0.0067629814147949
Output for 7.0.14
0.00056600570678711 0.0067689418792725
Output for 7.0.6
0.0004880428314209 0.0063068866729736
Output for 7.0.5
0.00051593780517578 Fatal error: Uncaught Error: Call to undefined function bcmod() in /in/tpNjr:64 Stack trace: #0 {main} thrown in /in/tpNjr on line 64
Process exited with code 255.
Output for 7.0.4
0.00047206878662109 0.0054519176483154
Output for 7.0.3
0.00031900405883789 0.0035650730133057
Output for 7.0.2
0.00047612190246582 0.005518913269043
Output for 7.0.1
0.00043296813964844 0.0049521923065186
Output for 7.0.0
0.00044488906860352 0.0053081512451172
Output for hhvm-3.12.0
0.0015511512756348 0.0097010135650635
Output for hhvm-3.10.0
0.0012469291687012 0.0066127777099609
Output for 5.6.28
0.0026330947875977 0.0091559886932373
Output for 5.6.21
0.0017340183258057 0.0078270435333252
Output for 5.6.20
0.001723051071167 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.6.19
0.0018200874328613 0.0063059329986572
Output for 5.6.18
0.0014948844909668 0.0060698986053467
Output for 5.6.17
0.0017421245574951 0.0076069831848145
Output for 5.6.16
0.001107931137085 0.0052118301391602
Output for 5.6.15
0.0018329620361328 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.6.14
0.0013489723205566 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.6.13
0.0014679431915283 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.6.12
0.001708984375 0.0081539154052734
Output for 5.6.11
0.0012540817260742 0.0060830116271973
Output for 5.6.10
0.0011000633239746 0.0052990913391113
Output for 5.6.9
0.0016570091247559 0.0078830718994141
Output for 5.6.8
0.0018329620361328 0.0089001655578613
Output for 5.5.35
0.0015759468078613 0.0070900917053223
Output for 5.5.34
0.0017800331115723 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.5.33
0.0015161037445068 0.0062739849090576
Output for 5.5.32
0.0015630722045898 0.0073070526123047
Output for 5.5.31
0.0013251304626465 0.0059139728546143
Output for 5.5.30
0.0011420249938965 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.5.29
0.001133918762207 Fatal error: Call to undefined function bcmod() in /in/tpNjr on line 64
Process exited with code 255.
Output for 5.5.28
0.0011389255523682 0.0054130554199219
Output for 5.5.27
0.0012710094451904 0.0058228969573975
Output for 5.5.26
0.0023648738861084 0.0091888904571533
Output for 5.5.25
0.0018007755279541 0.0082619190216064
Output for 5.5.24
0.0018749237060547 0.0083470344543457
Output for 5.4.45
Custom array_column()0.0018019676208496 0.0069220066070557
Output for 5.4.44
Custom array_column()0.0011007785797119 0.0047290325164795
Output for 5.4.43
Custom array_column()0.0017449855804443 0.0076408386230469
Output for 5.4.42
Custom array_column()0.0020229816436768 0.0079379081726074
Output for 5.4.41
Custom array_column()0.0012660026550293 0.0051441192626953
Output for 5.4.40
Custom array_column()0.0011320114135742 0.0047221183776855
Output for 5.4.39
Custom array_column()0.0019659996032715 0.0079271793365479
Output for 5.4.38
Custom array_column()0.001366138458252 0.0067009925842285
Output for 5.4.37
Custom array_column()0.0017719268798828 0.0072410106658936
Output for 5.4.36
Custom array_column()0.0013301372528076 0.0046470165252686
Output for 5.4.35
Custom array_column()0.0016970634460449 0.0070559978485107
Output for 5.4.34
Custom array_column()0.0019960403442383 0.0084140300750732
Output for 5.4.32
Custom array_column()0.001945972442627 0.0082108974456787
Output for 5.4.31
Custom array_column()0.0013551712036133 0.0056741237640381
Output for 5.4.30
Custom array_column()0.0015408992767334 0.0062971115112305
Output for 5.4.29
Custom array_column()0.0018999576568604 0.0075821876525879
Output for 5.4.28
Custom array_column()0.001884937286377 0.0076720714569092
Output for 5.4.27
Custom array_column()0.0018510818481445 0.0077180862426758
Output for 5.4.26
Custom array_column()0.0018191337585449 0.0073440074920654
Output for 5.4.25
Custom array_column()0.0019199848175049 0.0080018043518066
Output for 5.4.24
Custom array_column()0.0019700527191162 0.0078721046447754
Output for 5.4.23
Custom array_column()0.0017938613891602 0.007559061050415
Output for 5.4.22
Custom array_column()0.0015909671783447 0.006415843963623
Output for 5.4.21
Custom array_column()0.001162052154541 0.0048148632049561
Output for 5.4.20
Custom array_column()0.001816987991333 0.0069220066070557
Output for 5.4.19
Custom array_column()0.0018200874328613 0.0074949264526367
Output for 5.4.18
Custom array_column()0.001967191696167 0.0077080726623535
Output for 5.4.17
Custom array_column()0.001500129699707 0.0061929225921631
Output for 5.4.16
Custom array_column()0.0011990070343018 0.0049090385437012
Output for 5.4.15
Custom array_column()0.0013041496276855 0.0053670406341553
Output for 5.4.14
Custom array_column()0.0019259452819824 0.0075569152832031
Output for 5.4.13
Custom array_column()0.001816987991333 0.0076088905334473
Output for 5.4.12
Custom array_column()0.0016767978668213 0.0072557926177979
Output for 5.4.11
Custom array_column()0.0019979476928711 0.0079789161682129
Output for 5.4.10
Custom array_column()0.0017139911651611 0.007023811340332
Output for 5.4.9
Custom array_column()0.0019631385803223 0.007957935333252
Output for 5.4.8
Custom array_column()0.00199294090271 0.0077641010284424
Output for 5.4.7
Custom array_column()0.0016119480133057 0.0068621635437012
Output for 5.4.6
Custom array_column()0.0018100738525391 0.0076661109924316
Output for 5.4.5
Custom array_column()0.0014081001281738 0.0056779384613037
Output for 5.4.4
Custom array_column()0.0019011497497559 0.008004903793335
Output for 5.4.3
Custom array_column()0.0014190673828125 0.0063250064849854
Output for 5.4.2
Custom array_column()0.0012040138244629 0.0052258968353271
Output for 5.4.1
Custom array_column()0.0016410350799561 0.0069990158081055
Output for 5.4.0
Custom array_column()0.001896858215332 0.0073771476745605
Output for 5.3.29
Custom array_column()0.0020740032196045 0.0065748691558838
Output for 5.3.28
Custom array_column()0.0017609596252441 0.0065009593963623
Output for 5.3.27
Custom array_column()0.0021522045135498 0.0079951286315918
Output for 5.3.26
Custom array_column()0.0020840167999268 0.0082838535308838
Output for 5.3.25
Custom array_column()0.0027999877929688 0.010888814926147
Output for 5.3.24
Custom array_column()0.0020830631256104 0.0078918933868408
Output for 5.3.23
Custom array_column()0.0021078586578369 0.0085740089416504
Output for 5.3.22
Custom array_column()0.0020279884338379 0.0075931549072266
Output for 5.3.21
Custom array_column()0.0019969940185547 0.0079550743103027
Output for 5.3.20
Custom array_column()0.0019888877868652 0.0076529979705811
Output for 5.3.19
Custom array_column()0.001957893371582 0.007673978805542
Output for 5.3.18
Custom array_column()0.0016050338745117 0.0060880184173584
Output for 5.3.17
Custom array_column()0.002234935760498 0.008152961730957
Output for 5.3.16
Custom array_column()0.0023119449615479 0.0081031322479248
Output for 5.3.15
Custom array_column()0.0017240047454834 0.0053939819335938
Output for 5.3.14
Custom array_column()0.0022118091583252 0.008249044418335
Output for 5.3.13
Custom array_column()0.001737117767334 0.0071151256561279
Output for 5.3.12
Custom array_column()0.0022878646850586 0.0083720684051514
Output for 5.3.11
Custom array_column()0.0013339519500732 0.0050981044769287
Output for 5.3.10
Custom array_column()0.0021281242370605 0.0082170963287354
Output for 5.3.9
Custom array_column()0.0019350051879883 0.0076019763946533
Output for 5.3.8
Custom array_column()0.0019359588623047 0.0074920654296875
Output for 5.3.7
Custom array_column()0.0019071102142334 0.0072779655456543
Output for 5.3.6
Custom array_column()0.0022640228271484 0.0082559585571289
Output for 5.3.5
Custom array_column()0.0029060840606689 0.0084600448608398
Output for 5.3.4
Custom array_column()0.0013890266418457 0.0051651000976562
Output for 5.3.3
Custom array_column()0.0023050308227539 0.0083799362182617
Output for 5.3.2
Custom array_column()0.0020639896392822 0.0075969696044922
Output for 5.3.1
Custom array_column()0.0019710063934326 0.0069739818572998
Output for 5.3.0
Custom array_column()0.002000093460083 0.0073449611663818
Output for 5.2.17
Custom array_column()0.0018131732940674 0.0062699317932129
Output for 5.2.16
Custom array_column()0.0014238357543945 0.005073070526123
Output for 5.2.15
Custom array_column()0.0014159679412842 0.0050511360168457
Output for 5.2.14
Custom array_column()0.0021789073944092 0.0076539516448975
Output for 5.2.13
Custom array_column()0.0020310878753662 0.007274866104126
Output for 5.2.12
Custom array_column()0.0015609264373779 0.0055861473083496
Output for 5.2.11
Custom array_column()0.0026669502258301 0.0089199542999268
Output for 5.2.10
Custom array_column()0.0029909610748291 0.0088698863983154
Output for 5.2.9
Custom array_column()0.0026159286499023 0.0093450546264648
Output for 5.2.8
Custom array_column()0.0024960041046143 0.0090031623840332
Output for 5.2.7
Custom array_column()0.0026299953460693 0.0091719627380371
Output for 5.2.6
Custom array_column()0.002547025680542 0.0088779926300049
Output for 5.2.5
Custom array_column()0.0024969577789307 0.00901198387146
Output for 5.2.4
Custom array_column()0.0021440982818604 0.0074458122253418
Output for 5.2.3
Custom array_column()0.0017380714416504 0.0059800148010254
Output for 5.2.2
Custom array_column()0.0025179386138916 0.0088601112365723
Output for 5.2.1
Custom array_column()0.0024220943450928 0.0080900192260742
Output for 5.2.0
Custom array_column()0.0024969577789307 0.0083980560302734
Output for 5.1.6
Custom array_column()0.0024821758270264 0.0088069438934326
Output for 5.1.5
Custom array_column()0.0023090839385986 0.0079548358917236
Output for 5.1.4
Custom array_column()0.0018479824066162 0.0066080093383789
Output for 5.1.3
Custom array_column()0.0025320053100586 0.0092480182647705
Output for 5.1.2
Custom array_column()0.0025699138641357 0.0081140995025635
Output for 5.1.1
Custom array_column()0.0028209686279297 0.0087928771972656
Output for 5.1.0
Custom array_column()0.0022480487823486 0.0078439712524414
Output for 5.0.5
Custom array_column()0.0024850368499756 0.0061881542205811
Output for 5.0.4
Custom array_column()0.0045039653778076 0.011245965957642
Output for 5.0.3
Custom array_column()0.0034248828887939 0.0089070796966553
Output for 5.0.2
Custom array_column()0.0041170120239258 0.010246992111206
Output for 5.0.1
Custom array_column()0.0043799877166748 0.011312007904053
Output for 5.0.0
Custom array_column()0.0036938190460205 0.0095210075378418
Output for 4.4.9
Custom array_column()0.003504 0.008789
Output for 4.4.8
Custom array_column()0.004432 0.011305
Output for 4.4.7
Custom array_column()0.004202 0.010862
Output for 4.4.6
Custom array_column()0.004683 0.011427
Output for 4.4.5
Custom array_column()0.004574 0.011457
Output for 4.4.4
Custom array_column()0.003624 0.00906
Output for 4.4.3
Custom array_column()0.004418 0.011539
Output for 4.4.2
Custom array_column()0.004348 0.0112
Output for 4.4.1
Custom array_column()0.004228 0.010882
Output for 4.4.0
Custom array_column()0.003471 0.009039
Output for 4.3.11
Custom array_column()0.004614 0.011859
Output for 4.3.10
Custom array_column()0.00324 0.0090440000000001
Output for 4.3.9
Custom array_column()0.004564 0.011869
Output for 4.3.8
Custom array_column()0.003852 0.010594
Output for 4.3.7
Custom array_column()0.004251 0.010979
Output for 4.3.6
Custom array_column()0.003891 0.010267
Output for 4.3.5
Custom array_column()0.0036890000000001 0.009988
Output for 4.3.4
Custom array_column()0.0024879999999999 0.006983
Output for 4.3.3
Custom array_column()0.005508 0.013005
Output for 4.3.2
Custom array_column()0.004029 0.01071
Output for 4.3.1
Custom array_column()0.00338 0.009486
Output for 4.3.0
Custom array_column()0.003876 0.010263