Skip to content

Instantly share code, notes, and snippets.

@oraoto
Last active April 30, 2024 14:33
Show Gist options
  • Save oraoto/0345eba2e0bbd4e6a7da08a1a2cda918 to your computer and use it in GitHub Desktop.
Save oraoto/0345eba2e0bbd4e6a7da08a1a2cda918 to your computer and use it in GitHub Desktop.
Big Query统计最常用php函数
#standardSQL
CREATE TEMPORARY FUNCTION parseFunction(src STRING)
RETURNS ARRAY<STRING>
LANGUAGE js AS """
var result = [];
var regex = /([:\\w]+?)(?:\\()/g;
var match;
while (match = regex.exec(src)) {
result.push(match[1]);
}
return result;
""";
SELECT
function_name,
COUNT(function_name) AS count
FROM (
SELECT
parseFunction(c.content) AS function_name
FROM
`bigquery-public-data.github_repos.contents` c
JOIN (
SELECT
id
FROM
`bigquery-public-data.github_repos.sample_files`
where path like '%.php'
) f
ON f.id = c.id) f2,
UNNEST(function_name) AS function_name
WHERE
function_name IS NOT NULL
GROUP BY
function_name
ORDER BY
count DESC
LIMIT
1000
function_name count
array 9858572
isset 1601772
if 998555
empty 849381
assertEquals 819901
__ 542704
count 509832
substr 479225
get 469982
__construct 404270
is_array 335082
sprintf 313366
chr 303334
strlen 303068
assertTrue 302786
unset 280839
define 237314
str_replace 234320
in_array 218912
strpos 218054
preg_match 215149
trim 213025
foreach 212850
defined 193773
array_merge 182826
implode 178710
explode 177532
assertSame 174190
method 172470
expects 159796
strtolower 154908
getName 152595
add 147570
assertFalse 142747
set 141141
parent::__construct 138552
once 137626
preg_replace 136047
dirname 135107
class_exists 134010
require_once 130762
with 125332
_e 125145
function_exists 123880
is_null 119674
array_key_exists 118832
query 117174
function 117040
list 116678
is_string 115701
t 109339
file_exists 106775
will 101953
execute 100492
header 99877
getId 98763
apply_filters 98323
getMock 97149
shouldReceive 96838
date 95613
values 94852
save 90679
returnValue 90576
ord 90483
getMessage 89448
array_keys 86351
die 84740
getNamespace 84351
get_string 83330
time 82683
write 81340
intval 79843
getXsiTypeName 78884
render 78440
assertEqual 76793
is_numeric 74019
elseif 73899
exit 73718
Exception 73063
pack 71746
get_class 71338
load 69336
delete 69202
is_object 68666
htmlspecialchars 67669
esc_attr 63857
call 63756
where 62363
assign 61623
assertInstanceOf 61377
strtoupper 61254
create 60530
find 59914
setUp 59721
getValue 59077
read 58822
for 57874
file_get_contents 56035
andReturn 55857
trans 55685
InvalidArgumentException 54990
do_action 54843
_ 53869
func_get_args 53022
prepare 52846
get_option 52604
JText::_ 51483
willReturn 51254
end 49458
fopen 48468
add_action 48379
json_encode 48278
format 47931
getAttribute 47773
fclose 47656
reset 47161
parse 46889
array_shift 46633
fail 46622
round 44729
send 44385
toString 44080
select 43738
is_dir 43266
var_dump 43022
writeAttribute 42828
unlink 42624
md5 42553
escape 42182
appendChild 42120
validate 41931
array_map 41818
array_pop 41764
run 41699
include 41510
update 41499
printf 41341
log 40990
serialize 40418
Yii::t 40365
getType 39918
setAttribute 39186
_t 39111
getTable 39082
call_user_func_array 38996
switch 38825
setName 38804
strtotime 38708
fetch 38555
assertNull 38257
sizeof 38022
json_decode 37996
current_user_can 37876
curl_setopt 37587
assertContains 37521
register 37292
while 37283
error 37262
basename 37191
trigger_error 37191
init 37173
fwrite 36895
__toString 36814
fread 36769
str_repeat 36324
id 35925
any 35792
join 35724
close 35664
debug 35276
current 34929
toArray 34835
rtrim 34706
urlencode 34676
max 34429
require 33922
floor 33816
addElement 33315
call_user_func 33169
endElement 32802
DateTime 32800
stdClass 32762
startElement 32687
RuntimeException 32370
method_exists 32265
redirect 31982
array_values 31739
realpath 31273
jQuery 31041
esc_url 30875
getData 30795
getOption 30703
add_filter 30458
CakePHP 29985
getid3_lib::BigEndian2Int 29977
is_file 29723
post 29639
item 29466
flush 29389
setValue 29231
has 28943
array_push 28922
lang 28842
sanitize 28827
getMockBuilder 28821
ini_get 28785
next 28370
remove 28273
insert 27995
assertCount 27643
is_int 27499
version_compare 27496
: 27409
assertIdentical 27210
Yii::app 26966
getRequest 26963
key 26886
print_r 26733
microtime 26694
assert 26660
getKind 26573
from 26469
setKind 26460
getPath 26365
is 26174
at 26141
7 26042
preg_match_all 25942
getVar 25894
createElement 25540
all 25460
ob_start 25387
ts 25358
setId 25176
JHtml::_ 24996
preg_split 24989
evaluate 24985
include_once 24944
equalTo 24798
min 24675
getResponse 24668
addColumn 24606
start 24594
array_slice 24592
getElementById 24503
unserialize 24388
getContent 24260
getConnection 24257
skip 24235
exec 24118
esc_html 23946
print 23939
Response 23792
abs 23766
string 23671
mt_rand 23618
COUNT 23502
request 23493
wp_die 23491
parent::setUp 23449
assertArrayHasKey 23427
url 23366
text 23352
getUrl 23299
extension_loaded 23204
val 23159
base64_encode 22893
setType 22829
ucfirst 22783
Array 22742
getParam 22696
file_put_contents 22691
getCode 22648
array_unique 22579
extract 22515
initialize 22493
return 22492
is_wp_error 22377
line 22250
is_resource 22247
ini_set 22235
varchar 22163
PHPExcel_Calculation_Functions::flattenSingleValue 22087
getTitle 22079
clear 22074
process 21912
getQuery 21882
filter 21834
setError 21674
log_message 21626
unpack 21624
is_bool 21509
handle 20763
display 20632
rand 20627
isValid 20613
_out 20470
test 20403
preg_quote 20178
is_callable 20068
array_search 20014
var_export 19883
pht 19756
Request 19582
link 19578
_x 19550
getBody 19516
dispatch 19473
Mage::helper 19364
assertThat 19353
mkdir 19314
copy 19246
Lang::txt 19089
getMethod 19063
ltrim 19001
foo 18881
getConfig 18797
assertRegExp 18687
uniqid 18629
preg_replace_callback 18603
__call 18559
mysql_query 18551
tearDown 18381
getid3_lib::LittleEndian2Int 18355
connect 18236
str_pad 18176
contains 18110
getNode 18108
disableOriginalConstructor 18074
gettype 18051
getDescription 18048
array_filter 18024
match 17924
exists 17914
zeroOrMoreTimes 17888
setDescription 17887
stripslashes 17788
strtr 17757
quote 17755
setElementName 17726
fseek 17721
alert 17711
setExpectedException 17638
int 17535
setTitle 17412
setQuery 17347
__get 17323
compile 17298
getHeader 17080
add_query_arg 17053
strip_tags 17052
push 17035
getOptions 17010
strrpos 16949
ceil 16802
Column 16752
stripos 16743
shouldReturn 16712
field 16654
catch 16632
parse_url 16597
rewind 16543
seek 16542
attr 16510
ExclusionPolicy 16472
fmod 16344
array_unshift 16334
static::randomElement 16322
number_format 16316
pow 16276
get_post 16238
error_reporting 16216
addError 16189
open 16156
click 16156
drupalGet 16153
each 16151
translate 16092
WP_Error 16086
PEAR::isError 16081
__d 16063
compact 15931
self 15850
App::uses 15811
gmdate 15792
replace 15709
getLine 15657
mb_strlen 15654
markTestSkipped 15557
hexdec 15553
view 15552
model 15472
setParameter 15449
ReflectionClass 15421
generate 15298
append 15252
getElementValue 15218
admin_url 15174
writeln 15031
getStatusCode 14976
s 14895
get_instance 14848
gettext 14839
raw 14747
range 14737
sort 14678
name 14663
build 14622
filesize 14621
Route 14600
getState 14593
moodle_url 14559
getServer 14539
getUser 14535
assertNotNull 14479
bindValue 14437
strstr 14406
show 14402
Execute 14355
assertDef 14342
rawurlencode 14275
getParameter 14228
addChild 14169
ksort 14162
check 14030
value 13984
getArguments 13953
info 13903
commit 13858
eval 13853
quoteName 13812
getenv 13790
_string_shift 13780
assertInternalType 13700
ob_get_clean 13651
escape_identifiers 13634
_deprecated_function 13617
get_record 13454
persist 13434
never 13427
getHeaders 13422
on 13356
VARCHAR 13311
attach 13291
getSize 13280
is_readable 13272
children 13167
writeFieldBegin 13140
writeFieldEnd 13140
is_multisite 13125
mktime 13123
fetchAll 13115
setBody 13103
addslashes 13074
echo 13038
setOptions 13015
C 12970
in 12910
getDataGenerator 12893
encode 12887
getRepository 12886
mb_substr 12877
out 12844
assertText 12751
chmod 12711
config 12654
createCommand 12643
bind 12643
setData 12637
runStep 12587
G 12555
submit 12546
base64_decode 12540
absint 12486
getStatus 12470
getParent 12443
getText 12407
self::_GetInt2d 12388
PclZip::privErrorLog 12382
SetFont 12363
substr_count 12352
feof 12344
array_diff 12264
assertResult 12264
getError 12121
resolve 12070
getItems 12069
valid 12020
filemtime 12003
setOption 11954
array_reverse 11946
raiseError 11910
getDefinition 11885
fields 11845
fgets 11842
addSelectColumn 11778
Client 11710
emitToken 11657
LogicException 11589
PclZip::errorCode 11500
htmlentities 11462
ob_end_clean 11452
wp_enqueue_script 11393
trigger 11393
setHeader 11244
first 11228
env 11221
login 11214
syllableCount 11144
is_writable 11112
sql_query 11106
addOption 11100
html 11081
ftell 11074
getClient 11069
data 11037
drupalPostForm 11030
setup 11020
getElementsByTagName 10982
read_ushort 10950
getIterator 10949
assertTags 10882
dump 10778
index 10755
quoteIdentifier 10713
static 10704
getActiveSheet 10659
update_option 10657
PHPExcel_Calculation_Functions::VALUE 10649
randomMachineName 10630
get_object_vars 10614
__destruct 10602
clean 10595
class 10559
expect 10408
IXR_Error 10385
css 10344
attributes 10334
wp_parse_args 10299
base_url 10288
array_flip 10268
getUri 10267
fputs 10243
getParams 10219
setState 10210
getLabel 10173
setMethods 10168
getKey 10154
setDefault 10145
Error 10132
addSql 10129
invoke 10107
__set 10075
getStorage 10066
getParameters 10058
opendir 10055
getProperty 10037
search 10032
display_error 10030
optional_param 10013
CRM_Utils_Array::value 9989
GETPOST 9980
urldecode 9973
wp_unslash 9925
Mockery::any 9919
property_exists 9917
hash 9871
_error 9809
condition 9808
getVersion 9794
getRecord 9779
readdir 9737
put 9715
output 9709
Math_BigInteger 9689
strcasecmp 9674
getProperties 9664
stop 9655
getStream 9631
destroy 9616
sha1 9579
mail 9571
file 9558
show_error 9553
touch 9542
getPrimaryKey 9532
pathinfo 9530
Request::create 9519
setAccessible 9494
DateTimeZone 9463
getCommand 9462
label 9460
config_item 9457
_createMessage 9445
isEmpty 9424
rgba 9417
SetColor 9396
esc_attr_e 9389
getAll 9338
getStyle 9311
getSession 9304
is_a 9283
xpath 9277
authenticate 9272
getModel 9246
ready 9216
compare 9214
input 9213
getDOM 9213
ob_get_contents 9211
get_post_meta 9205
decode 9204
addField 9185
getAttributes 9183
get_current_screen 9152
setVar 9135
getHost 9118
getFilename 9112
sin 9107
bindParam 9075
up 9066
getField 9045
hasAttribute 9036
table 9027
mock 9026
getID 8988
checked 8987
set_error 8941
wp_redirect 8928
bin2hex 8905
floatval 8848
equals 8841
getWidth 8834
hide 8818
getMockery 8816
getToken 8805
configure 8794
getPosition 8769
get_permalink 8749
getErrors 8737
_createEncoder 8734
rename 8688
make 8672
error_log 8668
getClass 8630
get_var 8622
JFactory::getApplication 8586
site_url 8568
addListener 8564
cos 8550
_protect_identifiers 8541
q 8523
Configure::write 8515
limit 8487
getLocale 8413
section 8395
strncmp 8378
assertNotEmpty 8357
assertEmpty 8312
_createCache 8310
setItems 8252
getResult 8249
getInstance 8234
cmtx_define 8234
set_userdata 8216
sys_get_temp_dir 8196
substr_replace 8195
trailingslashit 8194
setMessage 8193
exactly 8184
http_build_query 8167
addAttribute 8161
__invoke 8154
matches 8113
offsetGet 8110
session_start 8109
strval 8045
object 8014
has_capability 8008
element 8004
getContainer 8003
update_post_meta 8003
setLabel 7993
_createHeaderSet 7975
Cell 7972
down 7941
then 7940
privCloseFd 7937
m::mock 7922
p 7914
h 7909
esc_html_e 7884
addClass 7862
get_field_id 7861
format_string 7836
getExtension 7835
escapeshellarg 7826
g 7826
get_results 7812
home_url 7792
type 7778
apply 7765
parent::init 7741
func_num_args 7740
one 7738
Criteria 7727
date_default_timezone_set 7720
array_splice 7701
chdir 7672
closedir 7668
setStatus 7662
factory 7658
encodeString 7656
InputOption 7646
PHPExcel_Cell::stringFromColumnIndex 7637
transform 7637
html_entity_decode 7630
andReturnUsing 7629
getHeight 7612
isNew 7604
external_value 7594
dechex 7592
Validation::cc 7588
getDefault 7588
PropelException 7576
PHPExcel_Calculation_Functions::NaN 7575
strftime 7538
getcwd 7527
getScenario 7501
shouldBeCalled 7500
PEAR::raiseError 7488
DOMDocument 7483
get_id 7465
_createHeader 7459
getFile 7434
setUrl 7392
getFont 7385
num_rows 7343
getTimestamp 7331
sleep 7325
version 7303
atLeastOnce 7289
supports 7244
setUser 7232
user_error 7229
PHPUnit_Util_InvalidArgumentHelper::factory 7213
offsetSet 7210
addArgument 7194
getMessages 7180
getResource 7174
getNextPageToken 7169
isColumnModified 7168
get_site_option 7161
getChildren 7152
print_error 7144
setContent 7131
setNextPageToken 7126
offsetExists 7112
setConfig 7093
stristr 7065
getMockForAbstractClass 7060
store 7047
selected 7044
getSource 7014
lookupNamespace 7012
readString 7003
lang_string 6984
getArgument 6982
setcookie 6975
setTimeout 6971
SUM 6969
_n 6959
JRoute::_ 6955
getObject 6937
addParam 6932
useObjects 6924
check_admin_referer 6909
JText::sprintf 6902
get_bloginfo 6894
mysql_error 6891
see 6878
have_posts 6870
constant 6869
setText 6866
ReflectionMethod 6835
iconv 6832
rollback 6828
assertNotEquals 6778
getPort 6778
insert_record 6777
orderBy 6762
array_fill 6759
nl2br 6749
Set 6747
Translate 6746
confirm 6723
is_admin 6675
Table 6663
asrt 6641
phpversion 6639
tempnam 6638
stream_get_contents 6635
filter_var 6632
str_split 6632
writeElement 6607
wp_nonce_field 6592
tra 6588
transferFromDOM 6585
getUsername 6582
xl 6581
getMetadata 6579
setKey 6574
getContext 6567
esc_html__ 6560
setCode 6559
coding_exception 6544
get_base 6535
ucwords 6523
Stroke 6518
integer 6512
curl_init 6508
sfConfig::get 6494
html_writer::tag 6487
CHtml::encode 6473
NOW 6465
is_scalar 6458
beConstructedWith 6448
stdout 6441
main 6440
parse_str 6439
get_query_var 6437
rmdir 6419
curl_exec 6412
Drupal::service 6406
getView 6396
verify 6394
getElement 6388
order 6366
getEtag 6362
merge 6353
getForm 6351
get_error_message 6327
ctype_digit 6306
strcmp 6292
route 6291
Mage::getModel 6265
glob 6260
getDate 6257
isArray 6255
insertElement 6251
mysql_real_escape_string 6243
self::_getFile 6238
widget 6234
getInput 6226
User 6220
tableName 6218
assertIsArray 6213
setSubject 6208
getAdapter 6206
setEtag 6176
getPost 6173
setMethod 6148
sqlesc 6136
get_config 6126
scalarNode 6122
andWhere 6115
diag 6112
getString 6081
result 6078
setPath 6056
writeString 6055
count_records 6043
PHPExcel_Exception 6041
wait 6031
beginTransaction 6016
Configure::read 6007
get_item_tags 5993
__clone 5958
getFileName 5957
flock 5943
setResponse 5938
split 5923
simplexml_load_string 5919
addFilter 5909
Mage::getSingleton 5895
getimagesize 5893
getValues 5893
getOutput 5881
encrypt 5880
now 5874
and 5868
add_field 5862
spl_autoload_register 5858
ArrayIterator 5855
mysql_fetch_array 5845
hasColumn 5805
getLevel 5794
normalize 5783
assertPattern 5779
rowCount 5773
setFrom 5771
parent::tearDown 5768
mockery_verify 5764
Config::get 5755
curl_close 5748
getRow 5735
char 5734
parent 5731
getMethods 5725
PHPUnit_Framework_TestFailure::exceptionToString 5718
setField 5717
Action 5704
T_ 5693
row 5676
getColumns 5668
get_name 5665
Twig_Node_Expression_Constant 5655
wp_enqueue_style 5645
set_error_handler 5632
Html::encode 5621
setParam 5610
bar 5608
getHashCode 5603
mb_convert_encoding 5600
visit 5594
isEqualTo 5587
submit_button 5584
authorise 5581
getLogger 5580
sqrt 5554
Lang::get 5548
db_query 5547
rgb 5546
assertRaw 5536
b 5521
setReturnValue 5512
getSelfLink 5496
warning 5492
setLocale 5485
setProperty 5470
resetAfterTest 5466
setSelfLink 5461
Application 5460
saveXML 5455
reveal 5454
_getParam 5447
protect_identifiers 5447
phpmailerException 5435
getTableName 5431
map 5425
_getHeader 5422
setContentType 5420
mb_strtolower 5420
getBaseUrl 5416
getScheme 5400
Html::a 5399
assertNotSame 5398
message 5396
response 5392
gradient 5384
isInstanceOf 5380
session_id 5377
number_format_i18n 5373
imagedestroy 5370
loadTemplate 5368
closeCursor 5364
returns 5353
assertResponse 5345
subcompile 5339
hydrate 5330
group 5329
getItem 5326
setHeaders 5318
add_help_tab 5316
InvalidConfigException 5315
returnCallback 5287
getColumn 5286
createTable 5285
Propel::getConnection 5280
getTag 5276
getController 5266
nullable 5265
Add 5259
setArguments 5251
pop 5236
offsetUnset 5223
restore_error_handler 5221
executeCommand 5219
pass 5218
elementInScope 5214
javascript:void 5205
addIndex 5204
drupalLogin 5202
free 5188
privSwapBackMagicQuotes 5184
removeClass 5175
wp_nonce_url 5155
addUsingAlias 5149
TCPDF_STATIC::empty_string 5140
disconnect 5134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment