basic_functions.c 169 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Andi Gutmans <andi@zend.com> |
  16. | Zeev Suraski <zeev@zend.com> |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. #include "php.h"
  21. #include "php_streams.h"
  22. #include "php_main.h"
  23. #include "php_globals.h"
  24. #include "php_ini.h"
  25. #include "php_standard.h"
  26. #include "php_math.h"
  27. #include "php_http.h"
  28. #include "php_incomplete_class.h"
  29. #include "php_getopt.h"
  30. #include "ext/standard/info.h"
  31. #include "ext/session/php_session.h"
  32. #include "zend_operators.h"
  33. #include "ext/standard/php_dns.h"
  34. #include "ext/standard/php_uuencode.h"
  35. #ifdef PHP_WIN32
  36. #include "win32/php_win32_globals.h"
  37. #include "win32/time.h"
  38. #endif
  39. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  40. #include "zend.h"
  41. #include "zend_ini_scanner.h"
  42. #include "zend_language_scanner.h"
  43. #include <zend_language_parser.h>
  44. #include <stdarg.h>
  45. #include <stdlib.h>
  46. #include <math.h>
  47. #include <time.h>
  48. #include <stdio.h>
  49. #ifndef PHP_WIN32
  50. #include <sys/types.h>
  51. #include <sys/stat.h>
  52. #endif
  53. #ifdef NETWARE
  54. #include <netinet/in.h>
  55. #endif
  56. #ifndef PHP_WIN32
  57. # include <netdb.h>
  58. #else
  59. #include "win32/inet.h"
  60. #endif
  61. #if HAVE_ARPA_INET_H
  62. # include <arpa/inet.h>
  63. #endif
  64. #if HAVE_UNISTD_H
  65. # include <unistd.h>
  66. #endif
  67. #if HAVE_STRING_H
  68. # include <string.h>
  69. #else
  70. # include <strings.h>
  71. #endif
  72. #if HAVE_LOCALE_H
  73. # include <locale.h>
  74. #endif
  75. #if HAVE_SYS_MMAN_H
  76. # include <sys/mman.h>
  77. #endif
  78. #if HAVE_SYS_LOADAVG_H
  79. # include <sys/loadavg.h>
  80. #endif
  81. #ifdef PHP_WIN32
  82. # include "win32/unistd.h"
  83. #endif
  84. #ifndef INADDR_NONE
  85. #define INADDR_NONE ((unsigned long int) -1)
  86. #endif
  87. #include "zend_globals.h"
  88. #include "php_globals.h"
  89. #include "SAPI.h"
  90. #include "php_ticks.h"
  91. #ifdef ZTS
  92. PHPAPI int basic_globals_id;
  93. #else
  94. PHPAPI php_basic_globals basic_globals;
  95. #endif
  96. #include "php_fopen_wrappers.h"
  97. #include "streamsfuncs.h"
  98. static zend_class_entry *incomplete_class_entry = NULL;
  99. typedef struct _user_tick_function_entry {
  100. zval **arguments;
  101. int arg_count;
  102. int calling;
  103. } user_tick_function_entry;
  104. /* some prototypes for local functions */
  105. static void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry);
  106. static void user_tick_function_dtor(user_tick_function_entry *tick_function_entry);
  107. static HashTable basic_submodules;
  108. #undef sprintf
  109. /* {{{ arginfo */
  110. /* {{{ main/main.c */
  111. ZEND_BEGIN_ARG_INFO(arginfo_set_time_limit, 0)
  112. ZEND_ARG_INFO(0, seconds)
  113. ZEND_END_ARG_INFO()
  114. /* }}} */
  115. /* {{{ main/sapi.c */
  116. ZEND_BEGIN_ARG_INFO(arginfo_header_register_callback, 0)
  117. ZEND_ARG_INFO(0, callback)
  118. ZEND_END_ARG_INFO()
  119. /* }}} */
  120. /* {{{ main/output.c */
  121. ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0)
  122. ZEND_ARG_INFO(0, user_function)
  123. ZEND_ARG_INFO(0, chunk_size)
  124. ZEND_ARG_INFO(0, flags)
  125. ZEND_END_ARG_INFO()
  126. ZEND_BEGIN_ARG_INFO(arginfo_ob_flush, 0)
  127. ZEND_END_ARG_INFO()
  128. ZEND_BEGIN_ARG_INFO(arginfo_ob_clean, 0)
  129. ZEND_END_ARG_INFO()
  130. ZEND_BEGIN_ARG_INFO(arginfo_ob_end_flush, 0)
  131. ZEND_END_ARG_INFO()
  132. ZEND_BEGIN_ARG_INFO(arginfo_ob_end_clean, 0)
  133. ZEND_END_ARG_INFO()
  134. ZEND_BEGIN_ARG_INFO(arginfo_ob_get_flush, 0)
  135. ZEND_END_ARG_INFO()
  136. ZEND_BEGIN_ARG_INFO(arginfo_ob_get_clean, 0)
  137. ZEND_END_ARG_INFO()
  138. ZEND_BEGIN_ARG_INFO(arginfo_ob_get_contents, 0)
  139. ZEND_END_ARG_INFO()
  140. ZEND_BEGIN_ARG_INFO(arginfo_ob_get_level, 0)
  141. ZEND_END_ARG_INFO()
  142. ZEND_BEGIN_ARG_INFO(arginfo_ob_get_length, 0)
  143. ZEND_END_ARG_INFO()
  144. ZEND_BEGIN_ARG_INFO(arginfo_ob_list_handlers, 0)
  145. ZEND_END_ARG_INFO()
  146. ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_get_status, 0, 0, 0)
  147. ZEND_ARG_INFO(0, full_status)
  148. ZEND_END_ARG_INFO()
  149. ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_implicit_flush, 0, 0, 0)
  150. ZEND_ARG_INFO(0, flag)
  151. ZEND_END_ARG_INFO()
  152. ZEND_BEGIN_ARG_INFO(arginfo_output_reset_rewrite_vars, 0)
  153. ZEND_END_ARG_INFO()
  154. ZEND_BEGIN_ARG_INFO(arginfo_output_add_rewrite_var, 0)
  155. ZEND_ARG_INFO(0, name)
  156. ZEND_ARG_INFO(0, value)
  157. ZEND_END_ARG_INFO()
  158. /* }}} */
  159. /* {{{ main/streams/userspace.c */
  160. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_wrapper_register, 0, 0, 2)
  161. ZEND_ARG_INFO(0, protocol)
  162. ZEND_ARG_INFO(0, classname)
  163. ZEND_ARG_INFO(0, flags)
  164. ZEND_END_ARG_INFO()
  165. ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_unregister, 0)
  166. ZEND_ARG_INFO(0, protocol)
  167. ZEND_END_ARG_INFO()
  168. ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_restore, 0)
  169. ZEND_ARG_INFO(0, protocol)
  170. ZEND_END_ARG_INFO()
  171. /* }}} */
  172. /* {{{ array.c */
  173. ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1)
  174. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  175. ZEND_ARG_INFO(0, sort_flags)
  176. ZEND_END_ARG_INFO()
  177. ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1)
  178. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  179. ZEND_ARG_INFO(0, sort_flags)
  180. ZEND_END_ARG_INFO()
  181. ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
  182. ZEND_ARG_INFO(0, var)
  183. ZEND_ARG_INFO(0, mode)
  184. ZEND_END_ARG_INFO()
  185. ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0)
  186. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  187. ZEND_END_ARG_INFO()
  188. ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0)
  189. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  190. ZEND_END_ARG_INFO()
  191. ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1)
  192. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  193. ZEND_ARG_INFO(0, sort_flags)
  194. ZEND_END_ARG_INFO()
  195. ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1)
  196. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  197. ZEND_ARG_INFO(0, sort_flags)
  198. ZEND_END_ARG_INFO()
  199. ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
  200. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  201. ZEND_ARG_INFO(0, sort_flags)
  202. ZEND_END_ARG_INFO()
  203. ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1)
  204. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  205. ZEND_ARG_INFO(0, sort_flags)
  206. ZEND_END_ARG_INFO()
  207. ZEND_BEGIN_ARG_INFO(arginfo_usort, 0)
  208. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  209. ZEND_ARG_INFO(0, cmp_function)
  210. ZEND_END_ARG_INFO()
  211. ZEND_BEGIN_ARG_INFO(arginfo_uasort, 0)
  212. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  213. ZEND_ARG_INFO(0, cmp_function)
  214. ZEND_END_ARG_INFO()
  215. ZEND_BEGIN_ARG_INFO(arginfo_uksort, 0)
  216. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  217. ZEND_ARG_INFO(0, cmp_function)
  218. ZEND_END_ARG_INFO()
  219. ZEND_BEGIN_ARG_INFO(arginfo_end, 0)
  220. ZEND_ARG_INFO(1, arg)
  221. ZEND_END_ARG_INFO()
  222. ZEND_BEGIN_ARG_INFO(arginfo_prev, 0)
  223. ZEND_ARG_INFO(1, arg)
  224. ZEND_END_ARG_INFO()
  225. ZEND_BEGIN_ARG_INFO(arginfo_next, 0)
  226. ZEND_ARG_INFO(1, arg)
  227. ZEND_END_ARG_INFO()
  228. ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
  229. ZEND_ARG_INFO(1, arg)
  230. ZEND_END_ARG_INFO()
  231. ZEND_BEGIN_ARG_INFO(arginfo_current, 0)
  232. ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
  233. ZEND_END_ARG_INFO()
  234. ZEND_BEGIN_ARG_INFO(arginfo_key, 0)
  235. ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
  236. ZEND_END_ARG_INFO()
  237. ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1)
  238. ZEND_ARG_VARIADIC_INFO(0, args)
  239. ZEND_END_ARG_INFO()
  240. ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1)
  241. ZEND_ARG_VARIADIC_INFO(0, args)
  242. ZEND_END_ARG_INFO()
  243. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
  244. ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
  245. ZEND_ARG_INFO(0, funcname)
  246. ZEND_ARG_INFO(0, userdata)
  247. ZEND_END_ARG_INFO()
  248. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2)
  249. ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
  250. ZEND_ARG_INFO(0, funcname)
  251. ZEND_ARG_INFO(0, userdata)
  252. ZEND_END_ARG_INFO()
  253. ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2)
  254. ZEND_ARG_INFO(0, needle)
  255. ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
  256. ZEND_ARG_INFO(0, strict)
  257. ZEND_END_ARG_INFO()
  258. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_search, 0, 0, 2)
  259. ZEND_ARG_INFO(0, needle)
  260. ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
  261. ZEND_ARG_INFO(0, strict)
  262. ZEND_END_ARG_INFO()
  263. ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
  264. ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */
  265. ZEND_ARG_INFO(0, extract_type)
  266. ZEND_ARG_INFO(0, prefix)
  267. ZEND_END_ARG_INFO()
  268. ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1)
  269. ZEND_ARG_VARIADIC_INFO(0, var_names)
  270. ZEND_END_ARG_INFO()
  271. ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
  272. ZEND_ARG_INFO(0, start_key)
  273. ZEND_ARG_INFO(0, num)
  274. ZEND_ARG_INFO(0, val)
  275. ZEND_END_ARG_INFO()
  276. ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0)
  277. ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
  278. ZEND_ARG_INFO(0, val)
  279. ZEND_END_ARG_INFO()
  280. ZEND_BEGIN_ARG_INFO_EX(arginfo_range, 0, 0, 2)
  281. ZEND_ARG_INFO(0, low)
  282. ZEND_ARG_INFO(0, high)
  283. ZEND_ARG_INFO(0, step)
  284. ZEND_END_ARG_INFO()
  285. ZEND_BEGIN_ARG_INFO(arginfo_shuffle, 0)
  286. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  287. ZEND_END_ARG_INFO()
  288. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 2)
  289. ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
  290. ZEND_ARG_VARIADIC_INFO(0, vars)
  291. ZEND_END_ARG_INFO()
  292. ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0)
  293. ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
  294. ZEND_END_ARG_INFO()
  295. ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0)
  296. ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
  297. ZEND_END_ARG_INFO()
  298. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 2)
  299. ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
  300. ZEND_ARG_VARIADIC_INFO(0, vars)
  301. ZEND_END_ARG_INFO()
  302. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
  303. ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
  304. ZEND_ARG_INFO(0, offset)
  305. ZEND_ARG_INFO(0, length)
  306. ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */
  307. ZEND_END_ARG_INFO()
  308. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
  309. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */
  310. ZEND_ARG_INFO(0, offset)
  311. ZEND_ARG_INFO(0, length)
  312. ZEND_ARG_INFO(0, preserve_keys)
  313. ZEND_END_ARG_INFO()
  314. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2)
  315. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
  316. ZEND_ARG_VARIADIC_INFO(0, arrays)
  317. ZEND_END_ARG_INFO()
  318. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2)
  319. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
  320. ZEND_ARG_VARIADIC_INFO(0, arrays)
  321. ZEND_END_ARG_INFO()
  322. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2)
  323. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
  324. ZEND_ARG_VARIADIC_INFO(0, arrays)
  325. ZEND_END_ARG_INFO()
  326. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2)
  327. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
  328. ZEND_ARG_VARIADIC_INFO(0, arrays)
  329. ZEND_END_ARG_INFO()
  330. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
  331. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  332. ZEND_ARG_INFO(0, search_value)
  333. ZEND_ARG_INFO(0, strict)
  334. ZEND_END_ARG_INFO()
  335. ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0)
  336. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  337. ZEND_END_ARG_INFO()
  338. ZEND_BEGIN_ARG_INFO(arginfo_array_count_values, 0)
  339. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  340. ZEND_END_ARG_INFO()
  341. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_column, 0, 0, 2)
  342. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  343. ZEND_ARG_INFO(0, column_key)
  344. ZEND_ARG_INFO(0, index_key)
  345. ZEND_END_ARG_INFO()
  346. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1)
  347. ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
  348. ZEND_ARG_INFO(0, preserve_keys)
  349. ZEND_END_ARG_INFO()
  350. ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0)
  351. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  352. ZEND_ARG_INFO(0, pad_size)
  353. ZEND_ARG_INFO(0, pad_value)
  354. ZEND_END_ARG_INFO()
  355. ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0)
  356. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  357. ZEND_END_ARG_INFO()
  358. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1)
  359. ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
  360. ZEND_ARG_INFO(0, case)
  361. ZEND_END_ARG_INFO()
  362. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unique, 0, 0, 1)
  363. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  364. ZEND_ARG_INFO(0, flags)
  365. ZEND_END_ARG_INFO()
  366. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_key, 0, 0, 2)
  367. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  368. ZEND_ARG_VARIADIC_INFO(0, arrays)
  369. ZEND_END_ARG_INFO()
  370. ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0)
  371. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  372. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  373. ZEND_ARG_INFO(0, callback_key_compare_func)
  374. ZEND_END_ARG_INFO()
  375. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect, 0, 0, 2)
  376. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  377. ZEND_ARG_VARIADIC_INFO(0, arrays)
  378. ZEND_END_ARG_INFO()
  379. ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0)
  380. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  381. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  382. ZEND_ARG_INFO(0, callback_data_compare_func)
  383. ZEND_END_ARG_INFO()
  384. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_assoc, 0, 0, 2)
  385. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  386. ZEND_ARG_VARIADIC_INFO(0, arrays)
  387. ZEND_END_ARG_INFO()
  388. ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0)
  389. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  390. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  391. ZEND_ARG_INFO(0, callback_data_compare_func)
  392. ZEND_END_ARG_INFO()
  393. ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_uassoc, 0)
  394. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  395. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  396. ZEND_ARG_INFO(0, callback_key_compare_func)
  397. ZEND_END_ARG_INFO()
  398. ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0)
  399. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  400. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  401. ZEND_ARG_INFO(0, callback_data_compare_func)
  402. ZEND_ARG_INFO(0, callback_key_compare_func)
  403. ZEND_END_ARG_INFO()
  404. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_key, 0, 0, 2)
  405. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  406. ZEND_ARG_VARIADIC_INFO(0, arrays)
  407. ZEND_END_ARG_INFO()
  408. ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0)
  409. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  410. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  411. ZEND_ARG_INFO(0, callback_key_comp_func)
  412. ZEND_END_ARG_INFO()
  413. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff, 0, 0, 2)
  414. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  415. ZEND_ARG_VARIADIC_INFO(0, arrays)
  416. ZEND_END_ARG_INFO()
  417. ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0)
  418. ZEND_ARG_INFO(0, arr1)
  419. ZEND_ARG_INFO(0, arr2)
  420. ZEND_ARG_INFO(0, callback_data_comp_func)
  421. ZEND_END_ARG_INFO()
  422. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_assoc, 0, 0, 2)
  423. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  424. ZEND_ARG_VARIADIC_INFO(0, arrays)
  425. ZEND_END_ARG_INFO()
  426. ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0)
  427. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  428. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  429. ZEND_ARG_INFO(0, callback_data_comp_func)
  430. ZEND_END_ARG_INFO()
  431. ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_assoc, 0)
  432. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  433. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  434. ZEND_ARG_INFO(0, callback_key_comp_func)
  435. ZEND_END_ARG_INFO()
  436. ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0)
  437. ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
  438. ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
  439. ZEND_ARG_INFO(0, callback_data_comp_func)
  440. ZEND_ARG_INFO(0, callback_key_comp_func)
  441. ZEND_END_ARG_INFO()
  442. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1)
  443. ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */
  444. ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order)
  445. ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags)
  446. ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2)
  447. ZEND_END_ARG_INFO()
  448. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
  449. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  450. ZEND_ARG_INFO(0, num_req)
  451. ZEND_END_ARG_INFO()
  452. ZEND_BEGIN_ARG_INFO(arginfo_array_sum, 0)
  453. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  454. ZEND_END_ARG_INFO()
  455. ZEND_BEGIN_ARG_INFO(arginfo_array_product, 0)
  456. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  457. ZEND_END_ARG_INFO()
  458. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2)
  459. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  460. ZEND_ARG_INFO(0, callback)
  461. ZEND_ARG_INFO(0, initial)
  462. ZEND_END_ARG_INFO()
  463. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
  464. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  465. ZEND_ARG_INFO(0, callback)
  466. ZEND_ARG_INFO(0, use_keys)
  467. ZEND_END_ARG_INFO()
  468. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
  469. ZEND_ARG_INFO(0, callback)
  470. ZEND_ARG_VARIADIC_INFO(0, arrays)
  471. ZEND_END_ARG_INFO()
  472. ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
  473. ZEND_ARG_INFO(0, key)
  474. ZEND_ARG_INFO(0, search)
  475. ZEND_END_ARG_INFO()
  476. ZEND_BEGIN_ARG_INFO_EX(arginfo_array_chunk, 0, 0, 2)
  477. ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  478. ZEND_ARG_INFO(0, size)
  479. ZEND_ARG_INFO(0, preserve_keys)
  480. ZEND_END_ARG_INFO()
  481. ZEND_BEGIN_ARG_INFO(arginfo_array_combine, 0)
  482. ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
  483. ZEND_ARG_INFO(0, values) /* ARRAY_INFO(0, values, 0) */
  484. ZEND_END_ARG_INFO()
  485. /* }}} */
  486. /* {{{ basic_functions.c */
  487. ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_gpc, 0)
  488. ZEND_END_ARG_INFO()
  489. ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_runtime, 0)
  490. ZEND_END_ARG_INFO()
  491. ZEND_BEGIN_ARG_INFO_EX(arginfo_set_magic_quotes_runtime, 0, 0, 1)
  492. ZEND_ARG_INFO(0, new_setting)
  493. ZEND_END_ARG_INFO()
  494. ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
  495. ZEND_ARG_INFO(0, const_name)
  496. ZEND_END_ARG_INFO()
  497. #ifdef HAVE_INET_NTOP
  498. ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
  499. ZEND_ARG_INFO(0, in_addr)
  500. ZEND_END_ARG_INFO()
  501. #endif
  502. #ifdef HAVE_INET_PTON
  503. ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
  504. ZEND_ARG_INFO(0, ip_address)
  505. ZEND_END_ARG_INFO()
  506. #endif
  507. ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
  508. ZEND_ARG_INFO(0, ip_address)
  509. ZEND_END_ARG_INFO()
  510. ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0)
  511. ZEND_ARG_INFO(0, proper_address)
  512. ZEND_END_ARG_INFO()
  513. ZEND_BEGIN_ARG_INFO_EX(arginfo_getenv, 0, 0, 1)
  514. ZEND_ARG_INFO(0, varname)
  515. ZEND_ARG_INFO(0, local_only)
  516. ZEND_END_ARG_INFO()
  517. #ifdef HAVE_PUTENV
  518. ZEND_BEGIN_ARG_INFO(arginfo_putenv, 0)
  519. ZEND_ARG_INFO(0, setting)
  520. ZEND_END_ARG_INFO()
  521. #endif
  522. ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1)
  523. ZEND_ARG_INFO(0, options)
  524. ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */
  525. ZEND_END_ARG_INFO()
  526. ZEND_BEGIN_ARG_INFO(arginfo_flush, 0)
  527. ZEND_END_ARG_INFO()
  528. ZEND_BEGIN_ARG_INFO(arginfo_sleep, 0)
  529. ZEND_ARG_INFO(0, seconds)
  530. ZEND_END_ARG_INFO()
  531. ZEND_BEGIN_ARG_INFO(arginfo_usleep, 0)
  532. ZEND_ARG_INFO(0, micro_seconds)
  533. ZEND_END_ARG_INFO()
  534. #if HAVE_NANOSLEEP
  535. ZEND_BEGIN_ARG_INFO(arginfo_time_nanosleep, 0)
  536. ZEND_ARG_INFO(0, seconds)
  537. ZEND_ARG_INFO(0, nanoseconds)
  538. ZEND_END_ARG_INFO()
  539. ZEND_BEGIN_ARG_INFO(arginfo_time_sleep_until, 0)
  540. ZEND_ARG_INFO(0, timestamp)
  541. ZEND_END_ARG_INFO()
  542. #endif
  543. ZEND_BEGIN_ARG_INFO(arginfo_get_current_user, 0)
  544. ZEND_END_ARG_INFO()
  545. ZEND_BEGIN_ARG_INFO(arginfo_get_cfg_var, 0)
  546. ZEND_ARG_INFO(0, option_name)
  547. ZEND_END_ARG_INFO()
  548. ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1)
  549. ZEND_ARG_INFO(0, message)
  550. ZEND_ARG_INFO(0, message_type)
  551. ZEND_ARG_INFO(0, destination)
  552. ZEND_ARG_INFO(0, extra_headers)
  553. ZEND_END_ARG_INFO()
  554. ZEND_BEGIN_ARG_INFO_EX(arginfo_error_get_last, 0, 0, 0)
  555. ZEND_END_ARG_INFO()
  556. ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func, 0, 0, 1)
  557. ZEND_ARG_INFO(0, function_name)
  558. ZEND_ARG_VARIADIC_INFO(0, parameters)
  559. ZEND_END_ARG_INFO()
  560. ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
  561. ZEND_ARG_INFO(0, function_name)
  562. ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
  563. ZEND_END_ARG_INFO()
  564. ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2)
  565. ZEND_ARG_INFO(0, method_name)
  566. ZEND_ARG_INFO(1, object)
  567. ZEND_ARG_VARIADIC_INFO(0, parameters)
  568. ZEND_END_ARG_INFO()
  569. ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
  570. ZEND_ARG_INFO(0, method_name)
  571. ZEND_ARG_INFO(1, object)
  572. ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
  573. ZEND_END_ARG_INFO()
  574. ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
  575. ZEND_ARG_INFO(0, function_name)
  576. ZEND_ARG_VARIADIC_INFO(0, parameters)
  577. ZEND_END_ARG_INFO()
  578. ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2)
  579. ZEND_ARG_INFO(0, function_name)
  580. ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
  581. ZEND_END_ARG_INFO()
  582. ZEND_BEGIN_ARG_INFO_EX(arginfo_register_shutdown_function, 0, 0, 1)
  583. ZEND_ARG_INFO(0, function_name)
  584. ZEND_ARG_VARIADIC_INFO(0, parameters)
  585. ZEND_END_ARG_INFO()
  586. ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1)
  587. ZEND_ARG_INFO(0, file_name)
  588. ZEND_ARG_INFO(0, return)
  589. ZEND_END_ARG_INFO()
  590. ZEND_BEGIN_ARG_INFO(arginfo_php_strip_whitespace, 0)
  591. ZEND_ARG_INFO(0, file_name)
  592. ZEND_END_ARG_INFO()
  593. ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_string, 0, 0, 1)
  594. ZEND_ARG_INFO(0, string)
  595. ZEND_ARG_INFO(0, return)
  596. ZEND_END_ARG_INFO()
  597. ZEND_BEGIN_ARG_INFO(arginfo_ini_get, 0)
  598. ZEND_ARG_INFO(0, varname)
  599. ZEND_END_ARG_INFO()
  600. ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0)
  601. ZEND_ARG_INFO(0, extension)
  602. ZEND_END_ARG_INFO()
  603. ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0)
  604. ZEND_ARG_INFO(0, varname)
  605. ZEND_ARG_INFO(0, newvalue)
  606. ZEND_END_ARG_INFO()
  607. ZEND_BEGIN_ARG_INFO(arginfo_ini_restore, 0)
  608. ZEND_ARG_INFO(0, varname)
  609. ZEND_END_ARG_INFO()
  610. ZEND_BEGIN_ARG_INFO(arginfo_set_include_path, 0)
  611. ZEND_ARG_INFO(0, new_include_path)
  612. ZEND_END_ARG_INFO()
  613. ZEND_BEGIN_ARG_INFO(arginfo_get_include_path, 0)
  614. ZEND_END_ARG_INFO()
  615. ZEND_BEGIN_ARG_INFO(arginfo_restore_include_path, 0)
  616. ZEND_END_ARG_INFO()
  617. ZEND_BEGIN_ARG_INFO_EX(arginfo_print_r, 0, 0, 1)
  618. ZEND_ARG_INFO(0, var)
  619. ZEND_ARG_INFO(0, return)
  620. ZEND_END_ARG_INFO()
  621. ZEND_BEGIN_ARG_INFO(arginfo_connection_aborted, 0)
  622. ZEND_END_ARG_INFO()
  623. ZEND_BEGIN_ARG_INFO(arginfo_connection_status, 0)
  624. ZEND_END_ARG_INFO()
  625. ZEND_BEGIN_ARG_INFO_EX(arginfo_ignore_user_abort, 0, 0, 0)
  626. ZEND_ARG_INFO(0, value)
  627. ZEND_END_ARG_INFO()
  628. #if HAVE_GETSERVBYNAME
  629. ZEND_BEGIN_ARG_INFO(arginfo_getservbyname, 0)
  630. ZEND_ARG_INFO(0, service)
  631. ZEND_ARG_INFO(0, protocol)
  632. ZEND_END_ARG_INFO()
  633. #endif
  634. #if HAVE_GETSERVBYPORT
  635. ZEND_BEGIN_ARG_INFO(arginfo_getservbyport, 0)
  636. ZEND_ARG_INFO(0, port)
  637. ZEND_ARG_INFO(0, protocol)
  638. ZEND_END_ARG_INFO()
  639. #endif
  640. #if HAVE_GETPROTOBYNAME
  641. ZEND_BEGIN_ARG_INFO(arginfo_getprotobyname, 0)
  642. ZEND_ARG_INFO(0, name)
  643. ZEND_END_ARG_INFO()
  644. #endif
  645. #if HAVE_GETPROTOBYNUMBER
  646. ZEND_BEGIN_ARG_INFO(arginfo_getprotobynumber, 0)
  647. ZEND_ARG_INFO(0, proto)
  648. ZEND_END_ARG_INFO()
  649. #endif
  650. ZEND_BEGIN_ARG_INFO_EX(arginfo_register_tick_function, 0, 0, 1)
  651. ZEND_ARG_INFO(0, function_name)
  652. ZEND_ARG_VARIADIC_INFO(0, parameters)
  653. ZEND_END_ARG_INFO()
  654. ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0)
  655. ZEND_ARG_INFO(0, function_name)
  656. ZEND_END_ARG_INFO()
  657. ZEND_BEGIN_ARG_INFO(arginfo_is_uploaded_file, 0)
  658. ZEND_ARG_INFO(0, path)
  659. ZEND_END_ARG_INFO()
  660. ZEND_BEGIN_ARG_INFO(arginfo_move_uploaded_file, 0)
  661. ZEND_ARG_INFO(0, path)
  662. ZEND_ARG_INFO(0, new_path)
  663. ZEND_END_ARG_INFO()
  664. ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_file, 0, 0, 1)
  665. ZEND_ARG_INFO(0, filename)
  666. ZEND_ARG_INFO(0, process_sections)
  667. ZEND_ARG_INFO(0, scanner_mode)
  668. ZEND_END_ARG_INFO()
  669. ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_string, 0, 0, 1)
  670. ZEND_ARG_INFO(0, ini_string)
  671. ZEND_ARG_INFO(0, process_sections)
  672. ZEND_ARG_INFO(0, scanner_mode)
  673. ZEND_END_ARG_INFO()
  674. #if ZEND_DEBUG
  675. ZEND_BEGIN_ARG_INFO(arginfo_config_get_hash, 0)
  676. ZEND_END_ARG_INFO()
  677. #endif
  678. #ifdef HAVE_GETLOADAVG
  679. ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0)
  680. ZEND_END_ARG_INFO()
  681. #endif
  682. /* }}} */
  683. /* {{{ assert.c */
  684. ZEND_BEGIN_ARG_INFO(arginfo_assert, 0)
  685. ZEND_ARG_INFO(0, assertion)
  686. ZEND_END_ARG_INFO()
  687. ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1)
  688. ZEND_ARG_INFO(0, what)
  689. ZEND_ARG_INFO(0, value)
  690. ZEND_END_ARG_INFO()
  691. /* }}} */
  692. /* {{{ base64.c */
  693. ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0)
  694. ZEND_ARG_INFO(0, str)
  695. ZEND_END_ARG_INFO()
  696. ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
  697. ZEND_ARG_INFO(0, str)
  698. ZEND_ARG_INFO(0, strict)
  699. ZEND_END_ARG_INFO()
  700. /* }}} */
  701. /* {{{ browscap.c */
  702. ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0)
  703. ZEND_ARG_INFO(0, browser_name)
  704. ZEND_ARG_INFO(0, return_array)
  705. ZEND_END_ARG_INFO()
  706. /* }}} */
  707. /* {{{ crc32.c */
  708. ZEND_BEGIN_ARG_INFO(arginfo_crc32, 0)
  709. ZEND_ARG_INFO(0, str)
  710. ZEND_END_ARG_INFO()
  711. /* }}} */
  712. /* {{{ crypt.c */
  713. #if HAVE_CRYPT
  714. ZEND_BEGIN_ARG_INFO_EX(arginfo_crypt, 0, 0, 1)
  715. ZEND_ARG_INFO(0, str)
  716. ZEND_ARG_INFO(0, salt)
  717. ZEND_END_ARG_INFO()
  718. #endif
  719. /* }}} */
  720. /* {{{ cyr_convert.c */
  721. ZEND_BEGIN_ARG_INFO(arginfo_convert_cyr_string, 0)
  722. ZEND_ARG_INFO(0, str)
  723. ZEND_ARG_INFO(0, from)
  724. ZEND_ARG_INFO(0, to)
  725. ZEND_END_ARG_INFO()
  726. /* }}} */
  727. /* {{{ datetime.c */
  728. #if HAVE_STRPTIME
  729. ZEND_BEGIN_ARG_INFO(arginfo_strptime, 0)
  730. ZEND_ARG_INFO(0, timestamp)
  731. ZEND_ARG_INFO(0, format)
  732. ZEND_END_ARG_INFO()
  733. #endif
  734. /* }}} */
  735. /* {{{ dir.c */
  736. ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1)
  737. ZEND_ARG_INFO(0, path)
  738. ZEND_ARG_INFO(0, context)
  739. ZEND_END_ARG_INFO()
  740. ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 1)
  741. ZEND_ARG_INFO(0, directory)
  742. ZEND_ARG_INFO(0, context)
  743. ZEND_END_ARG_INFO()
  744. ZEND_BEGIN_ARG_INFO_EX(arginfo_closedir, 0, 0, 0)
  745. ZEND_ARG_INFO(0, dir_handle)
  746. ZEND_END_ARG_INFO()
  747. #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
  748. ZEND_BEGIN_ARG_INFO(arginfo_chroot, 0)
  749. ZEND_ARG_INFO(0, directory)
  750. ZEND_END_ARG_INFO()
  751. #endif
  752. ZEND_BEGIN_ARG_INFO(arginfo_chdir, 0)
  753. ZEND_ARG_INFO(0, directory)
  754. ZEND_END_ARG_INFO()
  755. ZEND_BEGIN_ARG_INFO(arginfo_getcwd, 0)
  756. ZEND_END_ARG_INFO()
  757. ZEND_BEGIN_ARG_INFO_EX(arginfo_rewinddir, 0, 0, 0)
  758. ZEND_ARG_INFO(0, dir_handle)
  759. ZEND_END_ARG_INFO()
  760. ZEND_BEGIN_ARG_INFO_EX(arginfo_readdir, 0, 0, 0)
  761. ZEND_ARG_INFO(0, dir_handle)
  762. ZEND_END_ARG_INFO()
  763. #ifdef HAVE_GLOB
  764. ZEND_BEGIN_ARG_INFO_EX(arginfo_glob, 0, 0, 1)
  765. ZEND_ARG_INFO(0, pattern)
  766. ZEND_ARG_INFO(0, flags)
  767. ZEND_END_ARG_INFO()
  768. #endif
  769. ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1)
  770. ZEND_ARG_INFO(0, dir)
  771. ZEND_ARG_INFO(0, sorting_order)
  772. ZEND_ARG_INFO(0, context)
  773. ZEND_END_ARG_INFO()
  774. /* }}} */
  775. /* {{{ dns.c */
  776. ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0)
  777. ZEND_ARG_INFO(0, ip_address)
  778. ZEND_END_ARG_INFO()
  779. ZEND_BEGIN_ARG_INFO(arginfo_gethostbyname, 0)
  780. ZEND_ARG_INFO(0, hostname)
  781. ZEND_END_ARG_INFO()
  782. ZEND_BEGIN_ARG_INFO(arginfo_gethostbynamel, 0)
  783. ZEND_ARG_INFO(0, hostname)
  784. ZEND_END_ARG_INFO()
  785. #ifdef HAVE_GETHOSTNAME
  786. ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
  787. ZEND_END_ARG_INFO()
  788. #endif
  789. #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
  790. ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
  791. ZEND_ARG_INFO(0, host)
  792. ZEND_ARG_INFO(0, type)
  793. ZEND_END_ARG_INFO()
  794. # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
  795. ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 0, 0, 1)
  796. ZEND_ARG_INFO(0, hostname)
  797. ZEND_ARG_INFO(0, type)
  798. ZEND_ARG_ARRAY_INFO(1, authns, 1)
  799. ZEND_ARG_ARRAY_INFO(1, addtl, 1)
  800. ZEND_ARG_INFO(0, raw)
  801. ZEND_END_ARG_INFO()
  802. ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
  803. ZEND_ARG_INFO(0, hostname)
  804. ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */
  805. ZEND_ARG_INFO(1, weight) /* ARRAY_INFO(1, weight, 1) */
  806. ZEND_END_ARG_INFO()
  807. # endif
  808. #endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) */
  809. /* }}} */
  810. /* {{{ exec.c */
  811. ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1)
  812. ZEND_ARG_INFO(0, command)
  813. ZEND_ARG_INFO(1, output) /* ARRAY_INFO(1, output, 1) */
  814. ZEND_ARG_INFO(1, return_value)
  815. ZEND_END_ARG_INFO()
  816. ZEND_BEGIN_ARG_INFO_EX(arginfo_system, 0, 0, 1)
  817. ZEND_ARG_INFO(0, command)
  818. ZEND_ARG_INFO(1, return_value)
  819. ZEND_END_ARG_INFO()
  820. ZEND_BEGIN_ARG_INFO_EX(arginfo_passthru, 0, 0, 1)
  821. ZEND_ARG_INFO(0, command)
  822. ZEND_ARG_INFO(1, return_value)
  823. ZEND_END_ARG_INFO()
  824. ZEND_BEGIN_ARG_INFO(arginfo_escapeshellcmd, 0)
  825. ZEND_ARG_INFO(0, command)
  826. ZEND_END_ARG_INFO()
  827. ZEND_BEGIN_ARG_INFO(arginfo_escapeshellarg, 0)
  828. ZEND_ARG_INFO(0, arg)
  829. ZEND_END_ARG_INFO()
  830. ZEND_BEGIN_ARG_INFO(arginfo_shell_exec, 0)
  831. ZEND_ARG_INFO(0, cmd)
  832. ZEND_END_ARG_INFO()
  833. #ifdef HAVE_NICE
  834. ZEND_BEGIN_ARG_INFO(arginfo_proc_nice, 0)
  835. ZEND_ARG_INFO(0, priority)
  836. ZEND_END_ARG_INFO()
  837. #endif
  838. /* }}} */
  839. /* {{{ file.c */
  840. ZEND_BEGIN_ARG_INFO_EX(arginfo_flock, 0, 0, 2)
  841. ZEND_ARG_INFO(0, fp)
  842. ZEND_ARG_INFO(0, operation)
  843. ZEND_ARG_INFO(1, wouldblock)
  844. ZEND_END_ARG_INFO()
  845. ZEND_BEGIN_ARG_INFO_EX(arginfo_get_meta_tags, 0, 0, 1)
  846. ZEND_ARG_INFO(0, filename)
  847. ZEND_ARG_INFO(0, use_include_path)
  848. ZEND_END_ARG_INFO()
  849. ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1)
  850. ZEND_ARG_INFO(0, filename)
  851. ZEND_ARG_INFO(0, flags)
  852. ZEND_ARG_INFO(0, context)
  853. ZEND_ARG_INFO(0, offset)
  854. ZEND_ARG_INFO(0, maxlen)
  855. ZEND_END_ARG_INFO()
  856. ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2)
  857. ZEND_ARG_INFO(0, filename)
  858. ZEND_ARG_INFO(0, data)
  859. ZEND_ARG_INFO(0, flags)
  860. ZEND_ARG_INFO(0, context)
  861. ZEND_END_ARG_INFO()
  862. ZEND_BEGIN_ARG_INFO_EX(arginfo_file, 0, 0, 1)
  863. ZEND_ARG_INFO(0, filename)
  864. ZEND_ARG_INFO(0, flags)
  865. ZEND_ARG_INFO(0, context)
  866. ZEND_END_ARG_INFO()
  867. ZEND_BEGIN_ARG_INFO(arginfo_tempnam, 0)
  868. ZEND_ARG_INFO(0, dir)
  869. ZEND_ARG_INFO(0, prefix)
  870. ZEND_END_ARG_INFO()
  871. ZEND_BEGIN_ARG_INFO(arginfo_tmpfile, 0)
  872. ZEND_END_ARG_INFO()
  873. ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2)
  874. ZEND_ARG_INFO(0, filename)
  875. ZEND_ARG_INFO(0, mode)
  876. ZEND_ARG_INFO(0, use_include_path)
  877. ZEND_ARG_INFO(0, context)
  878. ZEND_END_ARG_INFO()
  879. ZEND_BEGIN_ARG_INFO(arginfo_fclose, 0)
  880. ZEND_ARG_INFO(0, fp)
  881. ZEND_END_ARG_INFO()
  882. ZEND_BEGIN_ARG_INFO(arginfo_popen, 0)
  883. ZEND_ARG_INFO(0, command)
  884. ZEND_ARG_INFO(0, mode)
  885. ZEND_END_ARG_INFO()
  886. ZEND_BEGIN_ARG_INFO(arginfo_pclose, 0)
  887. ZEND_ARG_INFO(0, fp)
  888. ZEND_END_ARG_INFO()
  889. ZEND_BEGIN_ARG_INFO(arginfo_feof, 0)
  890. ZEND_ARG_INFO(0, fp)
  891. ZEND_END_ARG_INFO()
  892. ZEND_BEGIN_ARG_INFO_EX(arginfo_fgets, 0, 0, 1)
  893. ZEND_ARG_INFO(0, fp)
  894. ZEND_ARG_INFO(0, length)
  895. ZEND_END_ARG_INFO()
  896. ZEND_BEGIN_ARG_INFO(arginfo_fgetc, 0)
  897. ZEND_ARG_INFO(0, fp)
  898. ZEND_END_ARG_INFO()
  899. ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1)
  900. ZEND_ARG_INFO(0, fp)
  901. ZEND_ARG_INFO(0, length)
  902. ZEND_ARG_INFO(0, allowable_tags)
  903. ZEND_END_ARG_INFO()
  904. ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 0, 0, 2)
  905. ZEND_ARG_INFO(0, stream)
  906. ZEND_ARG_INFO(0, format)
  907. ZEND_ARG_VARIADIC_INFO(1, vars)
  908. ZEND_END_ARG_INFO()
  909. ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2)
  910. ZEND_ARG_INFO(0, fp)
  911. ZEND_ARG_INFO(0, str)
  912. ZEND_ARG_INFO(0, length)
  913. ZEND_END_ARG_INFO()
  914. ZEND_BEGIN_ARG_INFO(arginfo_fflush, 0)
  915. ZEND_ARG_INFO(0, fp)
  916. ZEND_END_ARG_INFO()
  917. ZEND_BEGIN_ARG_INFO(arginfo_rewind, 0)
  918. ZEND_ARG_INFO(0, fp)
  919. ZEND_END_ARG_INFO()
  920. ZEND_BEGIN_ARG_INFO(arginfo_ftell, 0)
  921. ZEND_ARG_INFO(0, fp)
  922. ZEND_END_ARG_INFO()
  923. ZEND_BEGIN_ARG_INFO_EX(arginfo_fseek, 0, 0, 2)
  924. ZEND_ARG_INFO(0, fp)
  925. ZEND_ARG_INFO(0, offset)
  926. ZEND_ARG_INFO(0, whence)
  927. ZEND_END_ARG_INFO()
  928. ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1)
  929. ZEND_ARG_INFO(0, pathname)
  930. ZEND_ARG_INFO(0, mode)
  931. ZEND_ARG_INFO(0, recursive)
  932. ZEND_ARG_INFO(0, context)
  933. ZEND_END_ARG_INFO()
  934. ZEND_BEGIN_ARG_INFO_EX(arginfo_rmdir, 0, 0, 1)
  935. ZEND_ARG_INFO(0, dirname)
  936. ZEND_ARG_INFO(0, context)
  937. ZEND_END_ARG_INFO()
  938. ZEND_BEGIN_ARG_INFO_EX(arginfo_readfile, 0, 0, 1)
  939. ZEND_ARG_INFO(0, filename)
  940. ZEND_ARG_INFO(0, flags)
  941. ZEND_ARG_INFO(0, context)
  942. ZEND_END_ARG_INFO()
  943. ZEND_BEGIN_ARG_INFO_EX(arginfo_umask, 0, 0, 0)
  944. ZEND_ARG_INFO(0, mask)
  945. ZEND_END_ARG_INFO()
  946. ZEND_BEGIN_ARG_INFO(arginfo_fpassthru, 0)
  947. ZEND_ARG_INFO(0, fp)
  948. ZEND_END_ARG_INFO()
  949. ZEND_BEGIN_ARG_INFO_EX(arginfo_rename, 0, 0, 2)
  950. ZEND_ARG_INFO(0, old_name)
  951. ZEND_ARG_INFO(0, new_name)
  952. ZEND_ARG_INFO(0, context)
  953. ZEND_END_ARG_INFO()
  954. ZEND_BEGIN_ARG_INFO_EX(arginfo_unlink, 0, 0, 1)
  955. ZEND_ARG_INFO(0, filename)
  956. ZEND_ARG_INFO(0, context)
  957. ZEND_END_ARG_INFO()
  958. ZEND_BEGIN_ARG_INFO(arginfo_ftruncate, 0)
  959. ZEND_ARG_INFO(0, fp)
  960. ZEND_ARG_INFO(0, size)
  961. ZEND_END_ARG_INFO()
  962. ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0)
  963. ZEND_ARG_INFO(0, fp)
  964. ZEND_END_ARG_INFO()
  965. ZEND_BEGIN_ARG_INFO_EX(arginfo_copy, 0, 0, 2)
  966. ZEND_ARG_INFO(0, source_file)
  967. ZEND_ARG_INFO(0, destination_file)
  968. ZEND_ARG_INFO(0, context)
  969. ZEND_END_ARG_INFO()
  970. ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)
  971. ZEND_ARG_INFO(0, fp)
  972. ZEND_ARG_INFO(0, length)
  973. ZEND_END_ARG_INFO()
  974. ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2)
  975. ZEND_ARG_INFO(0, fp)
  976. ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 1) */
  977. ZEND_ARG_INFO(0, delimiter)
  978. ZEND_ARG_INFO(0, enclosure)
  979. ZEND_END_ARG_INFO()
  980. ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
  981. ZEND_ARG_INFO(0, fp)
  982. ZEND_ARG_INFO(0, length)
  983. ZEND_ARG_INFO(0, delimiter)
  984. ZEND_ARG_INFO(0, enclosure)
  985. ZEND_ARG_INFO(0, escape)
  986. ZEND_END_ARG_INFO()
  987. #if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
  988. ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
  989. ZEND_ARG_INFO(0, path)
  990. ZEND_END_ARG_INFO()
  991. #endif
  992. #ifdef HAVE_FNMATCH
  993. ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2)
  994. ZEND_ARG_INFO(0, pattern)
  995. ZEND_ARG_INFO(0, filename)
  996. ZEND_ARG_INFO(0, flags)
  997. ZEND_END_ARG_INFO()
  998. #endif
  999. ZEND_BEGIN_ARG_INFO(arginfo_sys_get_temp_dir, 0)
  1000. ZEND_END_ARG_INFO()
  1001. /* }}} */
  1002. /* {{{ filestat.c */
  1003. ZEND_BEGIN_ARG_INFO(arginfo_disk_total_space, 0)
  1004. ZEND_ARG_INFO(0, path)
  1005. ZEND_END_ARG_INFO()
  1006. ZEND_BEGIN_ARG_INFO(arginfo_disk_free_space, 0)
  1007. ZEND_ARG_INFO(0, path)
  1008. ZEND_END_ARG_INFO()
  1009. #ifndef NETWARE
  1010. ZEND_BEGIN_ARG_INFO(arginfo_chgrp, 0)
  1011. ZEND_ARG_INFO(0, filename)
  1012. ZEND_ARG_INFO(0, group)
  1013. ZEND_END_ARG_INFO()
  1014. ZEND_BEGIN_ARG_INFO(arginfo_chown, 0)
  1015. ZEND_ARG_INFO(0, filename)
  1016. ZEND_ARG_INFO(0, user)
  1017. ZEND_END_ARG_INFO()
  1018. #endif
  1019. #if HAVE_LCHOWN
  1020. ZEND_BEGIN_ARG_INFO(arginfo_lchgrp, 0)
  1021. ZEND_ARG_INFO(0, filename)
  1022. ZEND_ARG_INFO(0, group)
  1023. ZEND_END_ARG_INFO()
  1024. ZEND_BEGIN_ARG_INFO(arginfo_lchown, 0)
  1025. ZEND_ARG_INFO(0, filename)
  1026. ZEND_ARG_INFO(0, user)
  1027. ZEND_END_ARG_INFO()
  1028. #endif
  1029. ZEND_BEGIN_ARG_INFO(arginfo_chmod, 0)
  1030. ZEND_ARG_INFO(0, filename)
  1031. ZEND_ARG_INFO(0, mode)
  1032. ZEND_END_ARG_INFO()
  1033. #if HAVE_UTIME
  1034. ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1)
  1035. ZEND_ARG_INFO(0, filename)
  1036. ZEND_ARG_INFO(0, time)
  1037. ZEND_ARG_INFO(0, atime)
  1038. ZEND_END_ARG_INFO()
  1039. #endif
  1040. ZEND_BEGIN_ARG_INFO_EX(arginfo_clearstatcache, 0, 0, 0)
  1041. ZEND_ARG_INFO(0, clear_realpath_cache)
  1042. ZEND_ARG_INFO(0, filename)
  1043. ZEND_END_ARG_INFO()
  1044. ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_size, 0)
  1045. ZEND_END_ARG_INFO()
  1046. ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_get, 0)
  1047. ZEND_END_ARG_INFO()
  1048. ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0)
  1049. ZEND_ARG_INFO(0, filename)
  1050. ZEND_END_ARG_INFO()
  1051. ZEND_BEGIN_ARG_INFO(arginfo_fileinode, 0)
  1052. ZEND_ARG_INFO(0, filename)
  1053. ZEND_END_ARG_INFO()
  1054. ZEND_BEGIN_ARG_INFO(arginfo_filesize, 0)
  1055. ZEND_ARG_INFO(0, filename)
  1056. ZEND_END_ARG_INFO()
  1057. ZEND_BEGIN_ARG_INFO(arginfo_fileowner, 0)
  1058. ZEND_ARG_INFO(0, filename)
  1059. ZEND_END_ARG_INFO()
  1060. ZEND_BEGIN_ARG_INFO(arginfo_filegroup, 0)
  1061. ZEND_ARG_INFO(0, filename)
  1062. ZEND_END_ARG_INFO()
  1063. ZEND_BEGIN_ARG_INFO(arginfo_fileatime, 0)
  1064. ZEND_ARG_INFO(0, filename)
  1065. ZEND_END_ARG_INFO()
  1066. ZEND_BEGIN_ARG_INFO(arginfo_filemtime, 0)
  1067. ZEND_ARG_INFO(0, filename)
  1068. ZEND_END_ARG_INFO()
  1069. ZEND_BEGIN_ARG_INFO(arginfo_filectime, 0)
  1070. ZEND_ARG_INFO(0, filename)
  1071. ZEND_END_ARG_INFO()
  1072. ZEND_BEGIN_ARG_INFO(arginfo_filetype, 0)
  1073. ZEND_ARG_INFO(0, filename)
  1074. ZEND_END_ARG_INFO()
  1075. ZEND_BEGIN_ARG_INFO(arginfo_is_writable, 0)
  1076. ZEND_ARG_INFO(0, filename)
  1077. ZEND_END_ARG_INFO()
  1078. ZEND_BEGIN_ARG_INFO(arginfo_is_readable, 0)
  1079. ZEND_ARG_INFO(0, filename)
  1080. ZEND_END_ARG_INFO()
  1081. ZEND_BEGIN_ARG_INFO(arginfo_is_executable, 0)
  1082. ZEND_ARG_INFO(0, filename)
  1083. ZEND_END_ARG_INFO()
  1084. ZEND_BEGIN_ARG_INFO(arginfo_is_file, 0)
  1085. ZEND_ARG_INFO(0, filename)
  1086. ZEND_END_ARG_INFO()
  1087. ZEND_BEGIN_ARG_INFO(arginfo_is_dir, 0)
  1088. ZEND_ARG_INFO(0, filename)
  1089. ZEND_END_ARG_INFO()
  1090. ZEND_BEGIN_ARG_INFO(arginfo_is_link, 0)
  1091. ZEND_ARG_INFO(0, filename)
  1092. ZEND_END_ARG_INFO()
  1093. ZEND_BEGIN_ARG_INFO(arginfo_file_exists, 0)
  1094. ZEND_ARG_INFO(0, filename)
  1095. ZEND_END_ARG_INFO()
  1096. ZEND_BEGIN_ARG_INFO(arginfo_lstat, 0)
  1097. ZEND_ARG_INFO(0, filename)
  1098. ZEND_END_ARG_INFO()
  1099. ZEND_BEGIN_ARG_INFO(arginfo_stat, 0)
  1100. ZEND_ARG_INFO(0, filename)
  1101. ZEND_END_ARG_INFO()
  1102. /* }}} */
  1103. /* {{{ formatted_print.c */
  1104. ZEND_BEGIN_ARG_INFO_EX(arginfo_sprintf, 0, 0, 2)
  1105. ZEND_ARG_INFO(0, format)
  1106. ZEND_ARG_VARIADIC_INFO(0, args)
  1107. ZEND_END_ARG_INFO()
  1108. ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0)
  1109. ZEND_ARG_INFO(0, format)
  1110. ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
  1111. ZEND_END_ARG_INFO()
  1112. ZEND_BEGIN_ARG_INFO_EX(arginfo_printf, 0, 0, 1)
  1113. ZEND_ARG_INFO(0, format)
  1114. ZEND_ARG_VARIADIC_INFO(0, args)
  1115. ZEND_END_ARG_INFO()
  1116. ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0)
  1117. ZEND_ARG_INFO(0, format)
  1118. ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
  1119. ZEND_END_ARG_INFO()
  1120. ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2)
  1121. ZEND_ARG_INFO(0, stream)
  1122. ZEND_ARG_INFO(0, format)
  1123. ZEND_ARG_VARIADIC_INFO(0, args)
  1124. ZEND_END_ARG_INFO()
  1125. ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
  1126. ZEND_ARG_INFO(0, stream)
  1127. ZEND_ARG_INFO(0, format)
  1128. ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
  1129. ZEND_END_ARG_INFO()
  1130. /* }}} */
  1131. /* {{{ fsock.c */
  1132. ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2)
  1133. ZEND_ARG_INFO(0, hostname)
  1134. ZEND_ARG_INFO(0, port)
  1135. ZEND_ARG_INFO(1, errno)
  1136. ZEND_ARG_INFO(1, errstr)
  1137. ZEND_ARG_INFO(0, timeout)
  1138. ZEND_END_ARG_INFO()
  1139. ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 2)
  1140. ZEND_ARG_INFO(0, hostname)
  1141. ZEND_ARG_INFO(0, port)
  1142. ZEND_ARG_INFO(1, errno)
  1143. ZEND_ARG_INFO(1, errstr)
  1144. ZEND_ARG_INFO(0, timeout)
  1145. ZEND_END_ARG_INFO()
  1146. /* }}} */
  1147. /* {{{ ftok.c */
  1148. #if HAVE_FTOK
  1149. ZEND_BEGIN_ARG_INFO(arginfo_ftok, 0)
  1150. ZEND_ARG_INFO(0, pathname)
  1151. ZEND_ARG_INFO(0, proj)
  1152. ZEND_END_ARG_INFO()
  1153. #endif
  1154. /* }}} */
  1155. /* {{{ head.c */
  1156. ZEND_BEGIN_ARG_INFO_EX(arginfo_header, 0, 0, 1)
  1157. ZEND_ARG_INFO(0, header)
  1158. ZEND_ARG_INFO(0, replace)
  1159. ZEND_ARG_INFO(0, http_response_code)
  1160. ZEND_END_ARG_INFO()
  1161. ZEND_BEGIN_ARG_INFO_EX(arginfo_header_remove, 0, 0, 0)
  1162. ZEND_ARG_INFO(0, name)
  1163. ZEND_END_ARG_INFO()
  1164. ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1)
  1165. ZEND_ARG_INFO(0, name)
  1166. ZEND_ARG_INFO(0, value)
  1167. ZEND_ARG_INFO(0, expires)
  1168. ZEND_ARG_INFO(0, path)
  1169. ZEND_ARG_INFO(0, domain)
  1170. ZEND_ARG_INFO(0, secure)
  1171. ZEND_ARG_INFO(0, httponly)
  1172. ZEND_END_ARG_INFO()
  1173. ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1)
  1174. ZEND_ARG_INFO(0, name)
  1175. ZEND_ARG_INFO(0, value)
  1176. ZEND_ARG_INFO(0, expires)
  1177. ZEND_ARG_INFO(0, path)
  1178. ZEND_ARG_INFO(0, domain)
  1179. ZEND_ARG_INFO(0, secure)
  1180. ZEND_ARG_INFO(0, httponly)
  1181. ZEND_END_ARG_INFO()
  1182. ZEND_BEGIN_ARG_INFO_EX(arginfo_headers_sent, 0, 0, 0)
  1183. ZEND_ARG_INFO(1, file)
  1184. ZEND_ARG_INFO(1, line)
  1185. ZEND_END_ARG_INFO()
  1186. ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0)
  1187. ZEND_END_ARG_INFO()
  1188. ZEND_BEGIN_ARG_INFO_EX(arginfo_http_response_code, 0, 0, 0)
  1189. ZEND_ARG_INFO(0, response_code)
  1190. ZEND_END_ARG_INFO()
  1191. /* }}} */
  1192. /* {{{ html.c */
  1193. ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
  1194. ZEND_ARG_INFO(0, string)
  1195. ZEND_ARG_INFO(0, quote_style)
  1196. ZEND_ARG_INFO(0, charset)
  1197. ZEND_ARG_INFO(0, double_encode)
  1198. ZEND_END_ARG_INFO()
  1199. ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars_decode, 0, 0, 1)
  1200. ZEND_ARG_INFO(0, string)
  1201. ZEND_ARG_INFO(0, quote_style)
  1202. ZEND_END_ARG_INFO()
  1203. ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1)
  1204. ZEND_ARG_INFO(0, string)
  1205. ZEND_ARG_INFO(0, quote_style)
  1206. ZEND_ARG_INFO(0, charset)
  1207. ZEND_END_ARG_INFO()
  1208. ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1)
  1209. ZEND_ARG_INFO(0, string)
  1210. ZEND_ARG_INFO(0, quote_style)
  1211. ZEND_ARG_INFO(0, charset)
  1212. ZEND_ARG_INFO(0, double_encode)
  1213. ZEND_END_ARG_INFO()
  1214. ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0)
  1215. ZEND_ARG_INFO(0, table)
  1216. ZEND_ARG_INFO(0, quote_style)
  1217. ZEND_END_ARG_INFO()
  1218. /* }}} */
  1219. /* {{{ http.c */
  1220. ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1)
  1221. ZEND_ARG_INFO(0, formdata)
  1222. ZEND_ARG_INFO(0, prefix)
  1223. ZEND_ARG_INFO(0, arg_separator)
  1224. ZEND_ARG_INFO(0, enc_type)
  1225. ZEND_END_ARG_INFO()
  1226. /* }}} */
  1227. /* {{{ image.c */
  1228. ZEND_BEGIN_ARG_INFO(arginfo_image_type_to_mime_type, 0)
  1229. ZEND_ARG_INFO(0, imagetype)
  1230. ZEND_END_ARG_INFO()
  1231. ZEND_BEGIN_ARG_INFO_EX(arginfo_image_type_to_extension, 0, 0, 1)
  1232. ZEND_ARG_INFO(0, imagetype)
  1233. ZEND_ARG_INFO(0, include_dot)
  1234. ZEND_END_ARG_INFO()
  1235. ZEND_BEGIN_ARG_INFO_EX(arginfo_getimagesize, 0, 0, 1)
  1236. ZEND_ARG_INFO(0, imagefile)
  1237. ZEND_ARG_INFO(1, info) /* ARRAY_INFO(1, info, 1) */
  1238. ZEND_END_ARG_INFO()
  1239. /* }}} */
  1240. /* {{{ info.c */
  1241. ZEND_BEGIN_ARG_INFO_EX(arginfo_phpinfo, 0, 0, 0)
  1242. ZEND_ARG_INFO(0, what)
  1243. ZEND_END_ARG_INFO()
  1244. ZEND_BEGIN_ARG_INFO_EX(arginfo_phpversion, 0, 0, 0)
  1245. ZEND_ARG_INFO(0, extension)
  1246. ZEND_END_ARG_INFO()
  1247. ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
  1248. ZEND_ARG_INFO(0, flag)
  1249. ZEND_END_ARG_INFO()
  1250. ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
  1251. ZEND_END_ARG_INFO()
  1252. ZEND_BEGIN_ARG_INFO(arginfo_php_uname, 0)
  1253. ZEND_END_ARG_INFO()
  1254. ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0)
  1255. ZEND_END_ARG_INFO()
  1256. ZEND_BEGIN_ARG_INFO(arginfo_php_ini_loaded_file, 0)
  1257. ZEND_END_ARG_INFO()
  1258. /* }}} */
  1259. /* {{{ iptc.c */
  1260. ZEND_BEGIN_ARG_INFO_EX(arginfo_iptcembed, 0, 0, 2)
  1261. ZEND_ARG_INFO(0, iptcdata)
  1262. ZEND_ARG_INFO(0, jpeg_file_name)
  1263. ZEND_ARG_INFO(0, spool)
  1264. ZEND_END_ARG_INFO()
  1265. ZEND_BEGIN_ARG_INFO(arginfo_iptcparse, 0)
  1266. ZEND_ARG_INFO(0, iptcdata)
  1267. ZEND_END_ARG_INFO()
  1268. /* }}} */
  1269. /* {{{ lcg.c */
  1270. ZEND_BEGIN_ARG_INFO(arginfo_lcg_value, 0)
  1271. ZEND_END_ARG_INFO()
  1272. /* }}} */
  1273. /* {{{ levenshtein.c */
  1274. ZEND_BEGIN_ARG_INFO_EX(arginfo_levenshtein, 0, 0, 2)
  1275. ZEND_ARG_INFO(0, str1)
  1276. ZEND_ARG_INFO(0, str2)
  1277. ZEND_ARG_INFO(0, cost_ins)
  1278. ZEND_ARG_INFO(0, cost_rep)
  1279. ZEND_ARG_INFO(0, cost_del)
  1280. ZEND_END_ARG_INFO()
  1281. /* }}} */
  1282. /* {{{ link.c */
  1283. #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
  1284. ZEND_BEGIN_ARG_INFO(arginfo_readlink, 0)
  1285. ZEND_ARG_INFO(0, filename)
  1286. ZEND_END_ARG_INFO()
  1287. ZEND_BEGIN_ARG_INFO(arginfo_linkinfo, 0)
  1288. ZEND_ARG_INFO(0, filename)
  1289. ZEND_END_ARG_INFO()
  1290. ZEND_BEGIN_ARG_INFO(arginfo_symlink, 0)
  1291. ZEND_ARG_INFO(0, target)
  1292. ZEND_ARG_INFO(0, link)
  1293. ZEND_END_ARG_INFO()
  1294. ZEND_BEGIN_ARG_INFO(arginfo_link, 0)
  1295. ZEND_ARG_INFO(0, target)
  1296. ZEND_ARG_INFO(0, link)
  1297. ZEND_END_ARG_INFO()
  1298. #endif
  1299. /* }}} */
  1300. /* {{{ mail.c */
  1301. ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0)
  1302. ZEND_ARG_INFO(0, addr)
  1303. ZEND_END_ARG_INFO()
  1304. ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3)
  1305. ZEND_ARG_INFO(0, to)
  1306. ZEND_ARG_INFO(0, subject)
  1307. ZEND_ARG_INFO(0, message)
  1308. ZEND_ARG_INFO(0, additional_headers)
  1309. ZEND_ARG_INFO(0, additional_parameters)
  1310. ZEND_END_ARG_INFO()
  1311. /* }}} */
  1312. /* {{{ math.c */
  1313. ZEND_BEGIN_ARG_INFO(arginfo_abs, 0)
  1314. ZEND_ARG_INFO(0, number)
  1315. ZEND_END_ARG_INFO()
  1316. ZEND_BEGIN_ARG_INFO(arginfo_ceil, 0)
  1317. ZEND_ARG_INFO(0, number)
  1318. ZEND_END_ARG_INFO()
  1319. ZEND_BEGIN_ARG_INFO(arginfo_floor, 0)
  1320. ZEND_ARG_INFO(0, number)
  1321. ZEND_END_ARG_INFO()
  1322. ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1)
  1323. ZEND_ARG_INFO(0, number)
  1324. ZEND_ARG_INFO(0, precision)
  1325. ZEND_ARG_INFO(0, mode)
  1326. ZEND_END_ARG_INFO()
  1327. ZEND_BEGIN_ARG_INFO(arginfo_sin, 0)
  1328. ZEND_ARG_INFO(0, number)
  1329. ZEND_END_ARG_INFO()
  1330. ZEND_BEGIN_ARG_INFO(arginfo_cos, 0)
  1331. ZEND_ARG_INFO(0, number)
  1332. ZEND_END_ARG_INFO()
  1333. ZEND_BEGIN_ARG_INFO(arginfo_tan, 0)
  1334. ZEND_ARG_INFO(0, number)
  1335. ZEND_END_ARG_INFO()
  1336. ZEND_BEGIN_ARG_INFO(arginfo_asin, 0)
  1337. ZEND_ARG_INFO(0, number)
  1338. ZEND_END_ARG_INFO()
  1339. ZEND_BEGIN_ARG_INFO(arginfo_acos, 0)
  1340. ZEND_ARG_INFO(0, number)
  1341. ZEND_END_ARG_INFO()
  1342. ZEND_BEGIN_ARG_INFO(arginfo_atan, 0)
  1343. ZEND_ARG_INFO(0, number)
  1344. ZEND_END_ARG_INFO()
  1345. ZEND_BEGIN_ARG_INFO(arginfo_atan2, 0)
  1346. ZEND_ARG_INFO(0, y)
  1347. ZEND_ARG_INFO(0, x)
  1348. ZEND_END_ARG_INFO()
  1349. ZEND_BEGIN_ARG_INFO(arginfo_sinh, 0)
  1350. ZEND_ARG_INFO(0, number)
  1351. ZEND_END_ARG_INFO()
  1352. ZEND_BEGIN_ARG_INFO(arginfo_cosh, 0)
  1353. ZEND_ARG_INFO(0, number)
  1354. ZEND_END_ARG_INFO()
  1355. ZEND_BEGIN_ARG_INFO(arginfo_tanh, 0)
  1356. ZEND_ARG_INFO(0, number)
  1357. ZEND_END_ARG_INFO()
  1358. ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0)
  1359. ZEND_ARG_INFO(0, number)
  1360. ZEND_END_ARG_INFO()
  1361. ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0)
  1362. ZEND_ARG_INFO(0, number)
  1363. ZEND_END_ARG_INFO()
  1364. ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0)
  1365. ZEND_ARG_INFO(0, number)
  1366. ZEND_END_ARG_INFO()
  1367. ZEND_BEGIN_ARG_INFO(arginfo_pi, 0)
  1368. ZEND_END_ARG_INFO()
  1369. ZEND_BEGIN_ARG_INFO(arginfo_is_finite, 0)
  1370. ZEND_ARG_INFO(0, val)
  1371. ZEND_END_ARG_INFO()
  1372. ZEND_BEGIN_ARG_INFO(arginfo_is_infinite, 0)
  1373. ZEND_ARG_INFO(0, val)
  1374. ZEND_END_ARG_INFO()
  1375. ZEND_BEGIN_ARG_INFO(arginfo_is_nan, 0)
  1376. ZEND_ARG_INFO(0, val)
  1377. ZEND_END_ARG_INFO()
  1378. ZEND_BEGIN_ARG_INFO(arginfo_pow, 0)
  1379. ZEND_ARG_INFO(0, base)
  1380. ZEND_ARG_INFO(0, exponent)
  1381. ZEND_END_ARG_INFO()
  1382. ZEND_BEGIN_ARG_INFO(arginfo_exp, 0)
  1383. ZEND_ARG_INFO(0, number)
  1384. ZEND_END_ARG_INFO()
  1385. ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0)
  1386. ZEND_ARG_INFO(0, number)
  1387. ZEND_END_ARG_INFO()
  1388. ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0)
  1389. ZEND_ARG_INFO(0, number)
  1390. ZEND_END_ARG_INFO()
  1391. ZEND_BEGIN_ARG_INFO_EX(arginfo_log, 0, 0, 1)
  1392. ZEND_ARG_INFO(0, number)
  1393. ZEND_ARG_INFO(0, base)
  1394. ZEND_END_ARG_INFO()
  1395. ZEND_BEGIN_ARG_INFO(arginfo_log10, 0)
  1396. ZEND_ARG_INFO(0, number)
  1397. ZEND_END_ARG_INFO()
  1398. ZEND_BEGIN_ARG_INFO(arginfo_sqrt, 0)
  1399. ZEND_ARG_INFO(0, number)
  1400. ZEND_END_ARG_INFO()
  1401. ZEND_BEGIN_ARG_INFO(arginfo_hypot, 0)
  1402. ZEND_ARG_INFO(0, num1)
  1403. ZEND_ARG_INFO(0, num2)
  1404. ZEND_END_ARG_INFO()
  1405. ZEND_BEGIN_ARG_INFO(arginfo_deg2rad, 0)
  1406. ZEND_ARG_INFO(0, number)
  1407. ZEND_END_ARG_INFO()
  1408. ZEND_BEGIN_ARG_INFO(arginfo_rad2deg, 0)
  1409. ZEND_ARG_INFO(0, number)
  1410. ZEND_END_ARG_INFO()
  1411. ZEND_BEGIN_ARG_INFO(arginfo_bindec, 0)
  1412. ZEND_ARG_INFO(0, binary_number)
  1413. ZEND_END_ARG_INFO()
  1414. ZEND_BEGIN_ARG_INFO(arginfo_hexdec, 0)
  1415. ZEND_ARG_INFO(0, hexadecimal_number)
  1416. ZEND_END_ARG_INFO()
  1417. ZEND_BEGIN_ARG_INFO(arginfo_octdec, 0)
  1418. ZEND_ARG_INFO(0, octal_number)
  1419. ZEND_END_ARG_INFO()
  1420. ZEND_BEGIN_ARG_INFO(arginfo_decbin, 0)
  1421. ZEND_ARG_INFO(0, decimal_number)
  1422. ZEND_END_ARG_INFO()
  1423. ZEND_BEGIN_ARG_INFO(arginfo_decoct, 0)
  1424. ZEND_ARG_INFO(0, decimal_number)
  1425. ZEND_END_ARG_INFO()
  1426. ZEND_BEGIN_ARG_INFO(arginfo_dechex, 0)
  1427. ZEND_ARG_INFO(0, decimal_number)
  1428. ZEND_END_ARG_INFO()
  1429. ZEND_BEGIN_ARG_INFO(arginfo_base_convert, 0)
  1430. ZEND_ARG_INFO(0, number)
  1431. ZEND_ARG_INFO(0, frombase)
  1432. ZEND_ARG_INFO(0, tobase)
  1433. ZEND_END_ARG_INFO()
  1434. ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1)
  1435. ZEND_ARG_INFO(0, number)
  1436. ZEND_ARG_INFO(0, num_decimal_places)
  1437. ZEND_ARG_INFO(0, dec_separator)
  1438. ZEND_ARG_INFO(0, thousands_separator)
  1439. ZEND_END_ARG_INFO()
  1440. ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0)
  1441. ZEND_ARG_INFO(0, x)
  1442. ZEND_ARG_INFO(0, y)
  1443. ZEND_END_ARG_INFO()
  1444. /* }}} */
  1445. /* {{{ md5.c */
  1446. ZEND_BEGIN_ARG_INFO_EX(arginfo_md5, 0, 0, 1)
  1447. ZEND_ARG_INFO(0, str)
  1448. ZEND_ARG_INFO(0, raw_output)
  1449. ZEND_END_ARG_INFO()
  1450. ZEND_BEGIN_ARG_INFO_EX(arginfo_md5_file, 0, 0, 1)
  1451. ZEND_ARG_INFO(0, filename)
  1452. ZEND_ARG_INFO(0, raw_output)
  1453. ZEND_END_ARG_INFO()
  1454. /* }}} */
  1455. /* {{{ metaphone.c */
  1456. ZEND_BEGIN_ARG_INFO_EX(arginfo_metaphone, 0, 0, 1)
  1457. ZEND_ARG_INFO(0, text)
  1458. ZEND_ARG_INFO(0, phones)
  1459. ZEND_END_ARG_INFO()
  1460. /* }}} */
  1461. /* {{{ microtime.c */
  1462. #ifdef HAVE_GETTIMEOFDAY
  1463. ZEND_BEGIN_ARG_INFO_EX(arginfo_microtime, 0, 0, 0)
  1464. ZEND_ARG_INFO(0, get_as_float)
  1465. ZEND_END_ARG_INFO()
  1466. ZEND_BEGIN_ARG_INFO_EX(arginfo_gettimeofday, 0, 0, 0)
  1467. ZEND_ARG_INFO(0, get_as_float)
  1468. ZEND_END_ARG_INFO()
  1469. #endif
  1470. #ifdef HAVE_GETRUSAGE
  1471. ZEND_BEGIN_ARG_INFO_EX(arginfo_getrusage, 0, 0, 0)
  1472. ZEND_ARG_INFO(0, who)
  1473. ZEND_END_ARG_INFO()
  1474. #endif
  1475. /* }}} */
  1476. /* {{{ pack.c */
  1477. ZEND_BEGIN_ARG_INFO_EX(arginfo_pack, 0, 0, 2)
  1478. ZEND_ARG_INFO(0, format)
  1479. ZEND_ARG_VARIADIC_INFO(0, args)
  1480. ZEND_END_ARG_INFO()
  1481. ZEND_BEGIN_ARG_INFO(arginfo_unpack, 0)
  1482. ZEND_ARG_INFO(0, format)
  1483. ZEND_ARG_INFO(0, input)
  1484. ZEND_END_ARG_INFO()
  1485. /* }}} */
  1486. /* {{{ pageinfo.c */
  1487. ZEND_BEGIN_ARG_INFO(arginfo_getmyuid, 0)
  1488. ZEND_END_ARG_INFO()
  1489. ZEND_BEGIN_ARG_INFO(arginfo_getmygid, 0)
  1490. ZEND_END_ARG_INFO()
  1491. ZEND_BEGIN_ARG_INFO(arginfo_getmypid, 0)
  1492. ZEND_END_ARG_INFO()
  1493. ZEND_BEGIN_ARG_INFO(arginfo_getmyinode, 0)
  1494. ZEND_END_ARG_INFO()
  1495. ZEND_BEGIN_ARG_INFO(arginfo_getlastmod, 0)
  1496. ZEND_END_ARG_INFO()
  1497. /* }}} */
  1498. /* {{{ password.c */
  1499. ZEND_BEGIN_ARG_INFO_EX(arginfo_password_hash, 0, 0, 2)
  1500. ZEND_ARG_INFO(0, password)
  1501. ZEND_ARG_INFO(0, algo)
  1502. ZEND_ARG_INFO(0, options)
  1503. ZEND_END_ARG_INFO()
  1504. ZEND_BEGIN_ARG_INFO_EX(arginfo_password_get_info, 0, 0, 1)
  1505. ZEND_ARG_INFO(0, hash)
  1506. ZEND_END_ARG_INFO()
  1507. ZEND_BEGIN_ARG_INFO_EX(arginfo_password_needs_rehash, 0, 0, 2)
  1508. ZEND_ARG_INFO(0, hash)
  1509. ZEND_ARG_INFO(0, algo)
  1510. ZEND_ARG_INFO(0, options)
  1511. ZEND_END_ARG_INFO()
  1512. ZEND_BEGIN_ARG_INFO_EX(arginfo_password_verify, 0, 0, 2)
  1513. ZEND_ARG_INFO(0, password)
  1514. ZEND_ARG_INFO(0, hash)
  1515. ZEND_END_ARG_INFO()
  1516. /* }}} */
  1517. /* {{{ proc_open.c */
  1518. #ifdef PHP_CAN_SUPPORT_PROC_OPEN
  1519. ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_terminate, 0, 0, 1)
  1520. ZEND_ARG_INFO(0, process)
  1521. ZEND_ARG_INFO(0, signal)
  1522. ZEND_END_ARG_INFO()
  1523. ZEND_BEGIN_ARG_INFO(arginfo_proc_close, 0)
  1524. ZEND_ARG_INFO(0, process)
  1525. ZEND_END_ARG_INFO()
  1526. ZEND_BEGIN_ARG_INFO(arginfo_proc_get_status, 0)
  1527. ZEND_ARG_INFO(0, process)
  1528. ZEND_END_ARG_INFO()
  1529. ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3)
  1530. ZEND_ARG_INFO(0, command)
  1531. ZEND_ARG_INFO(0, descriptorspec) /* ARRAY_INFO(0, descriptorspec, 1) */
  1532. ZEND_ARG_INFO(1, pipes) /* ARRAY_INFO(1, pipes, 1) */
  1533. ZEND_ARG_INFO(0, cwd)
  1534. ZEND_ARG_INFO(0, env) /* ARRAY_INFO(0, env, 1) */
  1535. ZEND_ARG_INFO(0, other_options) /* ARRAY_INFO(0, other_options, 1) */
  1536. ZEND_END_ARG_INFO()
  1537. #endif
  1538. /* }}} */
  1539. /* {{{ quot_print.c */
  1540. ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_decode, 0)
  1541. ZEND_ARG_INFO(0, str)
  1542. ZEND_END_ARG_INFO()
  1543. /* }}} */
  1544. /* {{{ quot_print.c */
  1545. ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_encode, 0)
  1546. ZEND_ARG_INFO(0, str)
  1547. ZEND_END_ARG_INFO()
  1548. /* }}} */
  1549. /* {{{ rand.c */
  1550. ZEND_BEGIN_ARG_INFO_EX(arginfo_srand, 0, 0, 0)
  1551. ZEND_ARG_INFO(0, seed)
  1552. ZEND_END_ARG_INFO()
  1553. ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0)
  1554. ZEND_ARG_INFO(0, seed)
  1555. ZEND_END_ARG_INFO()
  1556. ZEND_BEGIN_ARG_INFO_EX(arginfo_rand, 0, 0, 0)
  1557. ZEND_ARG_INFO(0, min)
  1558. ZEND_ARG_INFO(0, max)
  1559. ZEND_END_ARG_INFO()
  1560. ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
  1561. ZEND_ARG_INFO(0, min)
  1562. ZEND_ARG_INFO(0, max)
  1563. ZEND_END_ARG_INFO()
  1564. ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0)
  1565. ZEND_END_ARG_INFO()
  1566. ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
  1567. ZEND_END_ARG_INFO()
  1568. /* }}} */
  1569. /* {{{ sha1.c */
  1570. ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1)
  1571. ZEND_ARG_INFO(0, str)
  1572. ZEND_ARG_INFO(0, raw_output)
  1573. ZEND_END_ARG_INFO()
  1574. ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1_file, 0, 0, 1)
  1575. ZEND_ARG_INFO(0, filename)
  1576. ZEND_ARG_INFO(0, raw_output)
  1577. ZEND_END_ARG_INFO()
  1578. /* }}} */
  1579. /* {{{ soundex.c */
  1580. ZEND_BEGIN_ARG_INFO(arginfo_soundex, 0)
  1581. ZEND_ARG_INFO(0, str)
  1582. ZEND_END_ARG_INFO()
  1583. /* }}} */
  1584. /* {{{ streamsfuncs.c */
  1585. #if HAVE_SOCKETPAIR
  1586. ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0)
  1587. ZEND_ARG_INFO(0, domain)
  1588. ZEND_ARG_INFO(0, type)
  1589. ZEND_ARG_INFO(0, protocol)
  1590. ZEND_END_ARG_INFO()
  1591. #endif
  1592. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1)
  1593. ZEND_ARG_INFO(0, remoteaddress)
  1594. ZEND_ARG_INFO(1, errcode)
  1595. ZEND_ARG_INFO(1, errstring)
  1596. ZEND_ARG_INFO(0, timeout)
  1597. ZEND_ARG_INFO(0, flags)
  1598. ZEND_ARG_INFO(0, context)
  1599. ZEND_END_ARG_INFO()
  1600. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1)
  1601. ZEND_ARG_INFO(0, localaddress)
  1602. ZEND_ARG_INFO(1, errcode)
  1603. ZEND_ARG_INFO(1, errstring)
  1604. ZEND_ARG_INFO(0, flags)
  1605. ZEND_ARG_INFO(0, context)
  1606. ZEND_END_ARG_INFO()
  1607. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1)
  1608. ZEND_ARG_INFO(0, serverstream)
  1609. ZEND_ARG_INFO(0, timeout)
  1610. ZEND_ARG_INFO(1, peername)
  1611. ZEND_END_ARG_INFO()
  1612. ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_get_name, 0)
  1613. ZEND_ARG_INFO(0, stream)
  1614. ZEND_ARG_INFO(0, want_peer)
  1615. ZEND_END_ARG_INFO()
  1616. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2)
  1617. ZEND_ARG_INFO(0, stream)
  1618. ZEND_ARG_INFO(0, data)
  1619. ZEND_ARG_INFO(0, flags)
  1620. ZEND_ARG_INFO(0, target_addr)
  1621. ZEND_END_ARG_INFO()
  1622. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2)
  1623. ZEND_ARG_INFO(0, stream)
  1624. ZEND_ARG_INFO(0, amount)
  1625. ZEND_ARG_INFO(0, flags)
  1626. ZEND_ARG_INFO(1, remote_addr)
  1627. ZEND_END_ARG_INFO()
  1628. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_contents, 0, 0, 1)
  1629. ZEND_ARG_INFO(0, source)
  1630. ZEND_ARG_INFO(0, maxlen)
  1631. ZEND_ARG_INFO(0, offset)
  1632. ZEND_END_ARG_INFO()
  1633. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2)
  1634. ZEND_ARG_INFO(0, source)
  1635. ZEND_ARG_INFO(0, dest)
  1636. ZEND_ARG_INFO(0, maxlen)
  1637. ZEND_ARG_INFO(0, pos)
  1638. ZEND_END_ARG_INFO()
  1639. ZEND_BEGIN_ARG_INFO(arginfo_stream_get_meta_data, 0)
  1640. ZEND_ARG_INFO(0, fp)
  1641. ZEND_END_ARG_INFO()
  1642. ZEND_BEGIN_ARG_INFO(arginfo_stream_get_transports, 0)
  1643. ZEND_END_ARG_INFO()
  1644. ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0)
  1645. ZEND_END_ARG_INFO()
  1646. ZEND_BEGIN_ARG_INFO(arginfo_stream_resolve_include_path, 0)
  1647. ZEND_ARG_INFO(0, filename)
  1648. ZEND_END_ARG_INFO()
  1649. ZEND_BEGIN_ARG_INFO(arginfo_stream_is_local, 0)
  1650. ZEND_ARG_INFO(0, stream)
  1651. ZEND_END_ARG_INFO()
  1652. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1)
  1653. ZEND_ARG_INFO(0, stream)
  1654. ZEND_END_ARG_INFO()
  1655. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4)
  1656. ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */
  1657. ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */
  1658. ZEND_ARG_INFO(1, except_streams) /* ARRAY_INFO(1, except_streams, 1) */
  1659. ZEND_ARG_INFO(0, tv_sec)
  1660. ZEND_ARG_INFO(0, tv_usec)
  1661. ZEND_END_ARG_INFO()
  1662. ZEND_BEGIN_ARG_INFO(arginfo_stream_context_get_options, 0)
  1663. ZEND_ARG_INFO(0, stream_or_context)
  1664. ZEND_END_ARG_INFO()
  1665. ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_option, 0)
  1666. ZEND_ARG_INFO(0, stream_or_context)
  1667. ZEND_ARG_INFO(0, wrappername)
  1668. ZEND_ARG_INFO(0, optionname)
  1669. ZEND_ARG_INFO(0, value)
  1670. ZEND_END_ARG_INFO()
  1671. ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_params, 0)
  1672. ZEND_ARG_INFO(0, stream_or_context)
  1673. ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
  1674. ZEND_END_ARG_INFO()
  1675. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_params, 0, ZEND_RETURN_VALUE, 1)
  1676. ZEND_ARG_INFO(0, stream_or_context)
  1677. ZEND_END_ARG_INFO()
  1678. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0)
  1679. ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
  1680. ZEND_END_ARG_INFO()
  1681. ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_default, 0)
  1682. ZEND_ARG_INFO(0, options)
  1683. ZEND_END_ARG_INFO()
  1684. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0)
  1685. ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
  1686. ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
  1687. ZEND_END_ARG_INFO()
  1688. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2)
  1689. ZEND_ARG_INFO(0, stream)
  1690. ZEND_ARG_INFO(0, filtername)
  1691. ZEND_ARG_INFO(0, read_write)
  1692. ZEND_ARG_INFO(0, filterparams)
  1693. ZEND_END_ARG_INFO()
  1694. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2)
  1695. ZEND_ARG_INFO(0, stream)
  1696. ZEND_ARG_INFO(0, filtername)
  1697. ZEND_ARG_INFO(0, read_write)
  1698. ZEND_ARG_INFO(0, filterparams)
  1699. ZEND_END_ARG_INFO()
  1700. ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_remove, 0)
  1701. ZEND_ARG_INFO(0, stream_filter)
  1702. ZEND_END_ARG_INFO()
  1703. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_line, 0, 0, 2)
  1704. ZEND_ARG_INFO(0, stream)
  1705. ZEND_ARG_INFO(0, maxlen)
  1706. ZEND_ARG_INFO(0, ending)
  1707. ZEND_END_ARG_INFO()
  1708. ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0)
  1709. ZEND_ARG_INFO(0, socket)
  1710. ZEND_ARG_INFO(0, mode)
  1711. ZEND_END_ARG_INFO()
  1712. #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
  1713. ZEND_BEGIN_ARG_INFO(arginfo_stream_set_timeout, 0)
  1714. ZEND_ARG_INFO(0, stream)
  1715. ZEND_ARG_INFO(0, seconds)
  1716. ZEND_ARG_INFO(0, microseconds)
  1717. ZEND_END_ARG_INFO()
  1718. #endif
  1719. ZEND_BEGIN_ARG_INFO(arginfo_stream_set_read_buffer, 0)
  1720. ZEND_ARG_INFO(0, fp)
  1721. ZEND_ARG_INFO(0, buffer)
  1722. ZEND_END_ARG_INFO()
  1723. ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0)
  1724. ZEND_ARG_INFO(0, fp)
  1725. ZEND_ARG_INFO(0, buffer)
  1726. ZEND_END_ARG_INFO()
  1727. ZEND_BEGIN_ARG_INFO(arginfo_stream_set_chunk_size, 0)
  1728. ZEND_ARG_INFO(0, fp)
  1729. ZEND_ARG_INFO(0, chunk_size)
  1730. ZEND_END_ARG_INFO()
  1731. ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2)
  1732. ZEND_ARG_INFO(0, stream)
  1733. ZEND_ARG_INFO(0, enable)
  1734. ZEND_ARG_INFO(0, cryptokind)
  1735. ZEND_ARG_INFO(0, sessionstream)
  1736. ZEND_END_ARG_INFO()
  1737. #ifdef HAVE_SHUTDOWN
  1738. ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_shutdown, 0)
  1739. ZEND_ARG_INFO(0, stream)
  1740. ZEND_ARG_INFO(0, how)
  1741. ZEND_END_ARG_INFO()
  1742. #endif
  1743. /* }}} */
  1744. /* {{{ string.c */
  1745. ZEND_BEGIN_ARG_INFO(arginfo_bin2hex, 0)
  1746. ZEND_ARG_INFO(0, data)
  1747. ZEND_END_ARG_INFO()
  1748. ZEND_BEGIN_ARG_INFO(arginfo_hex2bin, 0)
  1749. ZEND_ARG_INFO(0, data)
  1750. ZEND_END_ARG_INFO()
  1751. ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2)
  1752. ZEND_ARG_INFO(0, str)
  1753. ZEND_ARG_INFO(0, mask)
  1754. ZEND_ARG_INFO(0, start)
  1755. ZEND_ARG_INFO(0, len)
  1756. ZEND_END_ARG_INFO()
  1757. ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2)
  1758. ZEND_ARG_INFO(0, str)
  1759. ZEND_ARG_INFO(0, mask)
  1760. ZEND_ARG_INFO(0, start)
  1761. ZEND_ARG_INFO(0, len)
  1762. ZEND_END_ARG_INFO()
  1763. #if HAVE_NL_LANGINFO
  1764. ZEND_BEGIN_ARG_INFO(arginfo_nl_langinfo, 0)
  1765. ZEND_ARG_INFO(0, item)
  1766. ZEND_END_ARG_INFO()
  1767. #endif
  1768. #ifdef HAVE_STRCOLL
  1769. ZEND_BEGIN_ARG_INFO(arginfo_strcoll, 0)
  1770. ZEND_ARG_INFO(0, str1)
  1771. ZEND_ARG_INFO(0, str2)
  1772. ZEND_END_ARG_INFO()
  1773. #endif
  1774. ZEND_BEGIN_ARG_INFO_EX(arginfo_trim, 0, 0, 1)
  1775. ZEND_ARG_INFO(0, str)
  1776. ZEND_ARG_INFO(0, character_mask)
  1777. ZEND_END_ARG_INFO()
  1778. ZEND_BEGIN_ARG_INFO_EX(arginfo_rtrim, 0, 0, 1)
  1779. ZEND_ARG_INFO(0, str)
  1780. ZEND_ARG_INFO(0, character_mask)
  1781. ZEND_END_ARG_INFO()
  1782. ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 1)
  1783. ZEND_ARG_INFO(0, str)
  1784. ZEND_ARG_INFO(0, character_mask)
  1785. ZEND_END_ARG_INFO()
  1786. ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1)
  1787. ZEND_ARG_INFO(0, str)
  1788. ZEND_ARG_INFO(0, width)
  1789. ZEND_ARG_INFO(0, break)
  1790. ZEND_ARG_INFO(0, cut)
  1791. ZEND_END_ARG_INFO()
  1792. ZEND_BEGIN_ARG_INFO_EX(arginfo_explode, 0, 0, 2)
  1793. ZEND_ARG_INFO(0, separator)
  1794. ZEND_ARG_INFO(0, str)
  1795. ZEND_ARG_INFO(0, limit)
  1796. ZEND_END_ARG_INFO()
  1797. ZEND_BEGIN_ARG_INFO(arginfo_implode, 0)
  1798. ZEND_ARG_INFO(0, glue)
  1799. ZEND_ARG_INFO(0, pieces)
  1800. ZEND_END_ARG_INFO()
  1801. ZEND_BEGIN_ARG_INFO(arginfo_strtok, 0)
  1802. ZEND_ARG_INFO(0, str)
  1803. ZEND_ARG_INFO(0, token)
  1804. ZEND_END_ARG_INFO()
  1805. ZEND_BEGIN_ARG_INFO(arginfo_strtoupper, 0)
  1806. ZEND_ARG_INFO(0, str)
  1807. ZEND_END_ARG_INFO()
  1808. ZEND_BEGIN_ARG_INFO(arginfo_strtolower, 0)
  1809. ZEND_ARG_INFO(0, str)
  1810. ZEND_END_ARG_INFO()
  1811. ZEND_BEGIN_ARG_INFO_EX(arginfo_basename, 0, 0, 1)
  1812. ZEND_ARG_INFO(0, path)
  1813. ZEND_ARG_INFO(0, suffix)
  1814. ZEND_END_ARG_INFO()
  1815. ZEND_BEGIN_ARG_INFO(arginfo_dirname, 0)
  1816. ZEND_ARG_INFO(0, path)
  1817. ZEND_END_ARG_INFO()
  1818. ZEND_BEGIN_ARG_INFO_EX(arginfo_pathinfo, 0, 0, 1)
  1819. ZEND_ARG_INFO(0, path)
  1820. ZEND_ARG_INFO(0, options)
  1821. ZEND_END_ARG_INFO()
  1822. ZEND_BEGIN_ARG_INFO_EX(arginfo_stristr, 0, 0, 2)
  1823. ZEND_ARG_INFO(0, haystack)
  1824. ZEND_ARG_INFO(0, needle)
  1825. ZEND_ARG_INFO(0, part)
  1826. ZEND_END_ARG_INFO()
  1827. ZEND_BEGIN_ARG_INFO_EX(arginfo_strstr, 0, 0, 2)
  1828. ZEND_ARG_INFO(0, haystack)
  1829. ZEND_ARG_INFO(0, needle)
  1830. ZEND_ARG_INFO(0, part)
  1831. ZEND_END_ARG_INFO()
  1832. ZEND_BEGIN_ARG_INFO_EX(arginfo_strpos, 0, 0, 2)
  1833. ZEND_ARG_INFO(0, haystack)
  1834. ZEND_ARG_INFO(0, needle)
  1835. ZEND_ARG_INFO(0, offset)
  1836. ZEND_END_ARG_INFO()
  1837. ZEND_BEGIN_ARG_INFO_EX(arginfo_stripos, 0, 0, 2)
  1838. ZEND_ARG_INFO(0, haystack)
  1839. ZEND_ARG_INFO(0, needle)
  1840. ZEND_ARG_INFO(0, offset)
  1841. ZEND_END_ARG_INFO()
  1842. ZEND_BEGIN_ARG_INFO_EX(arginfo_strrpos, 0, 0, 2)
  1843. ZEND_ARG_INFO(0, haystack)
  1844. ZEND_ARG_INFO(0, needle)
  1845. ZEND_ARG_INFO(0, offset)
  1846. ZEND_END_ARG_INFO()
  1847. ZEND_BEGIN_ARG_INFO_EX(arginfo_strripos, 0, 0, 2)
  1848. ZEND_ARG_INFO(0, haystack)
  1849. ZEND_ARG_INFO(0, needle)
  1850. ZEND_ARG_INFO(0, offset)
  1851. ZEND_END_ARG_INFO()
  1852. ZEND_BEGIN_ARG_INFO(arginfo_strrchr, 0)
  1853. ZEND_ARG_INFO(0, haystack)
  1854. ZEND_ARG_INFO(0, needle)
  1855. ZEND_END_ARG_INFO()
  1856. ZEND_BEGIN_ARG_INFO_EX(arginfo_chunk_split, 0, 0, 1)
  1857. ZEND_ARG_INFO(0, str)
  1858. ZEND_ARG_INFO(0, chunklen)
  1859. ZEND_ARG_INFO(0, ending)
  1860. ZEND_END_ARG_INFO()
  1861. ZEND_BEGIN_ARG_INFO_EX(arginfo_substr, 0, 0, 2)
  1862. ZEND_ARG_INFO(0, str)
  1863. ZEND_ARG_INFO(0, start)
  1864. ZEND_ARG_INFO(0, length)
  1865. ZEND_END_ARG_INFO()
  1866. ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3)
  1867. ZEND_ARG_INFO(0, str)
  1868. ZEND_ARG_INFO(0, replace)
  1869. ZEND_ARG_INFO(0, start)
  1870. ZEND_ARG_INFO(0, length)
  1871. ZEND_END_ARG_INFO()
  1872. ZEND_BEGIN_ARG_INFO(arginfo_quotemeta, 0)
  1873. ZEND_ARG_INFO(0, str)
  1874. ZEND_END_ARG_INFO()
  1875. ZEND_BEGIN_ARG_INFO(arginfo_ord, 0)
  1876. ZEND_ARG_INFO(0, character)
  1877. ZEND_END_ARG_INFO()
  1878. ZEND_BEGIN_ARG_INFO(arginfo_chr, 0)
  1879. ZEND_ARG_INFO(0, codepoint)
  1880. ZEND_END_ARG_INFO()
  1881. ZEND_BEGIN_ARG_INFO(arginfo_ucfirst, 0)
  1882. ZEND_ARG_INFO(0, str)
  1883. ZEND_END_ARG_INFO()
  1884. ZEND_BEGIN_ARG_INFO(arginfo_lcfirst, 0)
  1885. ZEND_ARG_INFO(0, str)
  1886. ZEND_END_ARG_INFO()
  1887. ZEND_BEGIN_ARG_INFO_EX(arginfo_ucwords, 0, 0, 1)
  1888. ZEND_ARG_INFO(0, str)
  1889. ZEND_ARG_INFO(0, delimiters)
  1890. ZEND_END_ARG_INFO()
  1891. ZEND_BEGIN_ARG_INFO_EX(arginfo_strtr, 0, 0, 2)
  1892. ZEND_ARG_INFO(0, str)
  1893. ZEND_ARG_INFO(0, from)
  1894. ZEND_ARG_INFO(0, to)
  1895. ZEND_END_ARG_INFO()
  1896. ZEND_BEGIN_ARG_INFO(arginfo_strrev, 0)
  1897. ZEND_ARG_INFO(0, str)
  1898. ZEND_END_ARG_INFO()
  1899. ZEND_BEGIN_ARG_INFO_EX(arginfo_similar_text, 0, 0, 2)
  1900. ZEND_ARG_INFO(0, str1)
  1901. ZEND_ARG_INFO(0, str2)
  1902. ZEND_ARG_INFO(1, percent)
  1903. ZEND_END_ARG_INFO()
  1904. ZEND_BEGIN_ARG_INFO(arginfo_addcslashes, 0)
  1905. ZEND_ARG_INFO(0, str)
  1906. ZEND_ARG_INFO(0, charlist)
  1907. ZEND_END_ARG_INFO()
  1908. ZEND_BEGIN_ARG_INFO(arginfo_addslashes, 0)
  1909. ZEND_ARG_INFO(0, str)
  1910. ZEND_END_ARG_INFO()
  1911. ZEND_BEGIN_ARG_INFO(arginfo_stripcslashes, 0)
  1912. ZEND_ARG_INFO(0, str)
  1913. ZEND_END_ARG_INFO()
  1914. ZEND_BEGIN_ARG_INFO(arginfo_stripslashes, 0)
  1915. ZEND_ARG_INFO(0, str)
  1916. ZEND_END_ARG_INFO()
  1917. ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3)
  1918. ZEND_ARG_INFO(0, search)
  1919. ZEND_ARG_INFO(0, replace)
  1920. ZEND_ARG_INFO(0, subject)
  1921. ZEND_ARG_INFO(1, replace_count)
  1922. ZEND_END_ARG_INFO()
  1923. ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3)
  1924. ZEND_ARG_INFO(0, search)
  1925. ZEND_ARG_INFO(0, replace)
  1926. ZEND_ARG_INFO(0, subject)
  1927. ZEND_ARG_INFO(1, replace_count)
  1928. ZEND_END_ARG_INFO()
  1929. ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrev, 0, 0, 1)
  1930. ZEND_ARG_INFO(0, str)
  1931. ZEND_ARG_INFO(0, max_chars_per_line)
  1932. ZEND_END_ARG_INFO()
  1933. ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrevc, 0, 0, 1)
  1934. ZEND_ARG_INFO(0, str)
  1935. ZEND_ARG_INFO(0, max_chars_per_line)
  1936. ZEND_END_ARG_INFO()
  1937. ZEND_BEGIN_ARG_INFO_EX(arginfo_nl2br, 0, 0, 1)
  1938. ZEND_ARG_INFO(0, str)
  1939. ZEND_ARG_INFO(0, is_xhtml)
  1940. ZEND_END_ARG_INFO()
  1941. ZEND_BEGIN_ARG_INFO_EX(arginfo_strip_tags, 0, 0, 1)
  1942. ZEND_ARG_INFO(0, str)
  1943. ZEND_ARG_INFO(0, allowable_tags)
  1944. ZEND_END_ARG_INFO()
  1945. ZEND_BEGIN_ARG_INFO_EX(arginfo_setlocale, 0, 0, 2)
  1946. ZEND_ARG_INFO(0, category)
  1947. ZEND_ARG_VARIADIC_INFO(0, locales)
  1948. ZEND_END_ARG_INFO()
  1949. ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1)
  1950. ZEND_ARG_INFO(0, encoded_string)
  1951. ZEND_ARG_INFO(1, result)
  1952. ZEND_END_ARG_INFO()
  1953. ZEND_BEGIN_ARG_INFO_EX(arginfo_str_getcsv, 0, 0, 1)
  1954. ZEND_ARG_INFO(0, string)
  1955. ZEND_ARG_INFO(0, delimiter)
  1956. ZEND_ARG_INFO(0, enclosure)
  1957. ZEND_ARG_INFO(0, escape)
  1958. ZEND_END_ARG_INFO()
  1959. ZEND_BEGIN_ARG_INFO(arginfo_str_repeat, 0)
  1960. ZEND_ARG_INFO(0, input)
  1961. ZEND_ARG_INFO(0, mult)
  1962. ZEND_END_ARG_INFO()
  1963. ZEND_BEGIN_ARG_INFO_EX(arginfo_count_chars, 0, 0, 1)
  1964. ZEND_ARG_INFO(0, input)
  1965. ZEND_ARG_INFO(0, mode)
  1966. ZEND_END_ARG_INFO()
  1967. ZEND_BEGIN_ARG_INFO(arginfo_strnatcmp, 0)
  1968. ZEND_ARG_INFO(0, s1)
  1969. ZEND_ARG_INFO(0, s2)
  1970. ZEND_END_ARG_INFO()
  1971. ZEND_BEGIN_ARG_INFO(arginfo_localeconv, 0)
  1972. ZEND_END_ARG_INFO()
  1973. ZEND_BEGIN_ARG_INFO(arginfo_strnatcasecmp, 0)
  1974. ZEND_ARG_INFO(0, s1)
  1975. ZEND_ARG_INFO(0, s2)
  1976. ZEND_END_ARG_INFO()
  1977. ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2)
  1978. ZEND_ARG_INFO(0, haystack)
  1979. ZEND_ARG_INFO(0, needle)
  1980. ZEND_ARG_INFO(0, offset)
  1981. ZEND_ARG_INFO(0, length)
  1982. ZEND_END_ARG_INFO()
  1983. ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2)
  1984. ZEND_ARG_INFO(0, input)
  1985. ZEND_ARG_INFO(0, pad_length)
  1986. ZEND_ARG_INFO(0, pad_string)
  1987. ZEND_ARG_INFO(0, pad_type)
  1988. ZEND_END_ARG_INFO()
  1989. ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 0, 0, 2)
  1990. ZEND_ARG_INFO(0, str)
  1991. ZEND_ARG_INFO(0, format)
  1992. ZEND_ARG_VARIADIC_INFO(1, vars)
  1993. ZEND_END_ARG_INFO()
  1994. ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0)
  1995. ZEND_ARG_INFO(0, str)
  1996. ZEND_END_ARG_INFO()
  1997. ZEND_BEGIN_ARG_INFO(arginfo_str_shuffle, 0)
  1998. ZEND_ARG_INFO(0, str)
  1999. ZEND_END_ARG_INFO()
  2000. ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1)
  2001. ZEND_ARG_INFO(0, str)
  2002. ZEND_ARG_INFO(0, format)
  2003. ZEND_ARG_INFO(0, charlist)
  2004. ZEND_END_ARG_INFO()
  2005. #ifdef HAVE_STRFMON
  2006. ZEND_BEGIN_ARG_INFO(arginfo_money_format, 0)
  2007. ZEND_ARG_INFO(0, format)
  2008. ZEND_ARG_INFO(0, value)
  2009. ZEND_END_ARG_INFO()
  2010. #endif
  2011. ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1)
  2012. ZEND_ARG_INFO(0, str)
  2013. ZEND_ARG_INFO(0, split_length)
  2014. ZEND_END_ARG_INFO()
  2015. ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 1)
  2016. ZEND_ARG_INFO(0, haystack)
  2017. ZEND_ARG_INFO(0, char_list)
  2018. ZEND_END_ARG_INFO()
  2019. ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_compare, 0, 0, 3)
  2020. ZEND_ARG_INFO(0, main_str)
  2021. ZEND_ARG_INFO(0, str)
  2022. ZEND_ARG_INFO(0, offset)
  2023. ZEND_ARG_INFO(0, length)
  2024. ZEND_ARG_INFO(0, case_sensitivity)
  2025. ZEND_END_ARG_INFO()
  2026. /* }}} */
  2027. /* {{{ syslog.c */
  2028. #ifdef HAVE_SYSLOG_H
  2029. ZEND_BEGIN_ARG_INFO(arginfo_openlog, 0)
  2030. ZEND_ARG_INFO(0, ident)
  2031. ZEND_ARG_INFO(0, option)
  2032. ZEND_ARG_INFO(0, facility)
  2033. ZEND_END_ARG_INFO()
  2034. ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0)
  2035. ZEND_END_ARG_INFO()
  2036. ZEND_BEGIN_ARG_INFO(arginfo_syslog, 0)
  2037. ZEND_ARG_INFO(0, priority)
  2038. ZEND_ARG_INFO(0, message)
  2039. ZEND_END_ARG_INFO()
  2040. #endif
  2041. /* }}} */
  2042. /* {{{ type.c */
  2043. ZEND_BEGIN_ARG_INFO(arginfo_gettype, 0)
  2044. ZEND_ARG_INFO(0, var)
  2045. ZEND_END_ARG_INFO()
  2046. ZEND_BEGIN_ARG_INFO(arginfo_settype, 0)
  2047. ZEND_ARG_INFO(1, var)
  2048. ZEND_ARG_INFO(0, type)
  2049. ZEND_END_ARG_INFO()
  2050. ZEND_BEGIN_ARG_INFO_EX(arginfo_intval, 0, 0, 1)
  2051. ZEND_ARG_INFO(0, var)
  2052. ZEND_ARG_INFO(0, base)
  2053. ZEND_END_ARG_INFO()
  2054. ZEND_BEGIN_ARG_INFO(arginfo_floatval, 0)
  2055. ZEND_ARG_INFO(0, var)
  2056. ZEND_END_ARG_INFO()
  2057. ZEND_BEGIN_ARG_INFO(arginfo_strval, 0)
  2058. ZEND_ARG_INFO(0, var)
  2059. ZEND_END_ARG_INFO()
  2060. ZEND_BEGIN_ARG_INFO(arginfo_boolval, 0)
  2061. ZEND_ARG_INFO(0, var)
  2062. ZEND_END_ARG_INFO()
  2063. ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0)
  2064. ZEND_ARG_INFO(0, var)
  2065. ZEND_END_ARG_INFO()
  2066. ZEND_BEGIN_ARG_INFO(arginfo_is_resource, 0)
  2067. ZEND_ARG_INFO(0, var)
  2068. ZEND_END_ARG_INFO()
  2069. ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0)
  2070. ZEND_ARG_INFO(0, var)
  2071. ZEND_END_ARG_INFO()
  2072. ZEND_BEGIN_ARG_INFO(arginfo_is_long, 0)
  2073. ZEND_ARG_INFO(0, var)
  2074. ZEND_END_ARG_INFO()
  2075. ZEND_BEGIN_ARG_INFO(arginfo_is_float, 0)
  2076. ZEND_ARG_INFO(0, var)
  2077. ZEND_END_ARG_INFO()
  2078. ZEND_BEGIN_ARG_INFO(arginfo_is_string, 0)
  2079. ZEND_ARG_INFO(0, var)
  2080. ZEND_END_ARG_INFO()
  2081. ZEND_BEGIN_ARG_INFO(arginfo_is_array, 0)
  2082. ZEND_ARG_INFO(0, var)
  2083. ZEND_END_ARG_INFO()
  2084. ZEND_BEGIN_ARG_INFO(arginfo_is_object, 0)
  2085. ZEND_ARG_INFO(0, var)
  2086. ZEND_END_ARG_INFO()
  2087. ZEND_BEGIN_ARG_INFO(arginfo_is_numeric, 0)
  2088. ZEND_ARG_INFO(0, value)
  2089. ZEND_END_ARG_INFO()
  2090. ZEND_BEGIN_ARG_INFO(arginfo_is_scalar, 0)
  2091. ZEND_ARG_INFO(0, value)
  2092. ZEND_END_ARG_INFO()
  2093. ZEND_BEGIN_ARG_INFO_EX(arginfo_is_callable, 0, 0, 1)
  2094. ZEND_ARG_INFO(0, var)
  2095. ZEND_ARG_INFO(0, syntax_only)
  2096. ZEND_ARG_INFO(1, callable_name)
  2097. ZEND_END_ARG_INFO()
  2098. /* }}} */
  2099. /* {{{ uniqid.c */
  2100. #ifdef HAVE_GETTIMEOFDAY
  2101. ZEND_BEGIN_ARG_INFO_EX(arginfo_uniqid, 0, 0, 0)
  2102. ZEND_ARG_INFO(0, prefix)
  2103. ZEND_ARG_INFO(0, more_entropy)
  2104. ZEND_END_ARG_INFO()
  2105. #endif
  2106. /* }}} */
  2107. /* {{{ url.c */
  2108. ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1)
  2109. ZEND_ARG_INFO(0, url)
  2110. ZEND_ARG_INFO(0, component)
  2111. ZEND_END_ARG_INFO()
  2112. ZEND_BEGIN_ARG_INFO(arginfo_urlencode, 0)
  2113. ZEND_ARG_INFO(0, str)
  2114. ZEND_END_ARG_INFO()
  2115. ZEND_BEGIN_ARG_INFO(arginfo_urldecode, 0)
  2116. ZEND_ARG_INFO(0, str)
  2117. ZEND_END_ARG_INFO()
  2118. ZEND_BEGIN_ARG_INFO(arginfo_rawurlencode, 0)
  2119. ZEND_ARG_INFO(0, str)
  2120. ZEND_END_ARG_INFO()
  2121. ZEND_BEGIN_ARG_INFO(arginfo_rawurldecode, 0)
  2122. ZEND_ARG_INFO(0, str)
  2123. ZEND_END_ARG_INFO()
  2124. ZEND_BEGIN_ARG_INFO_EX(arginfo_get_headers, 0, 0, 1)
  2125. ZEND_ARG_INFO(0, url)
  2126. ZEND_ARG_INFO(0, format)
  2127. ZEND_END_ARG_INFO()
  2128. /* }}} */
  2129. /* {{{ user_filters.c */
  2130. ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_make_writeable, 0)
  2131. ZEND_ARG_INFO(0, brigade)
  2132. ZEND_END_ARG_INFO()
  2133. ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_prepend, 0)
  2134. ZEND_ARG_INFO(0, brigade)
  2135. ZEND_ARG_INFO(0, bucket)
  2136. ZEND_END_ARG_INFO()
  2137. ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_append, 0)
  2138. ZEND_ARG_INFO(0, brigade)
  2139. ZEND_ARG_INFO(0, bucket)
  2140. ZEND_END_ARG_INFO()
  2141. ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_new, 0)
  2142. ZEND_ARG_INFO(0, stream)
  2143. ZEND_ARG_INFO(0, buffer)
  2144. ZEND_END_ARG_INFO()
  2145. ZEND_BEGIN_ARG_INFO(arginfo_stream_get_filters, 0)
  2146. ZEND_END_ARG_INFO()
  2147. ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_register, 0)
  2148. ZEND_ARG_INFO(0, filtername)
  2149. ZEND_ARG_INFO(0, classname)
  2150. ZEND_END_ARG_INFO()
  2151. /* }}} */
  2152. /* {{{ uuencode.c */
  2153. ZEND_BEGIN_ARG_INFO(arginfo_convert_uuencode, 0)
  2154. ZEND_ARG_INFO(0, data)
  2155. ZEND_END_ARG_INFO()
  2156. ZEND_BEGIN_ARG_INFO(arginfo_convert_uudecode, 0)
  2157. ZEND_ARG_INFO(0, data)
  2158. ZEND_END_ARG_INFO()
  2159. /* }}} */
  2160. /* {{{ var.c */
  2161. ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1)
  2162. ZEND_ARG_VARIADIC_INFO(0, vars)
  2163. ZEND_END_ARG_INFO()
  2164. ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1)
  2165. ZEND_ARG_VARIADIC_INFO(0, vars)
  2166. ZEND_END_ARG_INFO()
  2167. ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1)
  2168. ZEND_ARG_INFO(0, var)
  2169. ZEND_ARG_INFO(0, return)
  2170. ZEND_END_ARG_INFO()
  2171. ZEND_BEGIN_ARG_INFO(arginfo_serialize, 0)
  2172. ZEND_ARG_INFO(0, var)
  2173. ZEND_END_ARG_INFO()
  2174. ZEND_BEGIN_ARG_INFO(arginfo_unserialize, 0)
  2175. ZEND_ARG_INFO(0, variable_representation)
  2176. ZEND_END_ARG_INFO()
  2177. ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0)
  2178. ZEND_ARG_INFO(0, real_usage)
  2179. ZEND_END_ARG_INFO()
  2180. ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0)
  2181. ZEND_ARG_INFO(0, real_usage)
  2182. ZEND_END_ARG_INFO()
  2183. /* }}} */
  2184. /* {{{ versioning.c */
  2185. ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
  2186. ZEND_ARG_INFO(0, ver1)
  2187. ZEND_ARG_INFO(0, ver2)
  2188. ZEND_ARG_INFO(0, oper)
  2189. ZEND_END_ARG_INFO()
  2190. /* }}} */
  2191. /* }}} */
  2192. const zend_function_entry basic_functions[] = { /* {{{ */
  2193. PHP_FE(constant, arginfo_constant)
  2194. PHP_FE(bin2hex, arginfo_bin2hex)
  2195. PHP_FE(hex2bin, arginfo_hex2bin)
  2196. PHP_FE(sleep, arginfo_sleep)
  2197. PHP_FE(usleep, arginfo_usleep)
  2198. #if HAVE_NANOSLEEP
  2199. PHP_FE(time_nanosleep, arginfo_time_nanosleep)
  2200. PHP_FE(time_sleep_until, arginfo_time_sleep_until)
  2201. #endif
  2202. #if HAVE_STRPTIME
  2203. PHP_FE(strptime, arginfo_strptime)
  2204. #endif
  2205. PHP_FE(flush, arginfo_flush)
  2206. PHP_FE(wordwrap, arginfo_wordwrap)
  2207. PHP_FE(htmlspecialchars, arginfo_htmlspecialchars)
  2208. PHP_FE(htmlentities, arginfo_htmlentities)
  2209. PHP_FE(html_entity_decode, arginfo_html_entity_decode)
  2210. PHP_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode)
  2211. PHP_FE(get_html_translation_table, arginfo_get_html_translation_table)
  2212. PHP_FE(sha1, arginfo_sha1)
  2213. PHP_FE(sha1_file, arginfo_sha1_file)
  2214. PHP_NAMED_FE(md5,php_if_md5, arginfo_md5)
  2215. PHP_NAMED_FE(md5_file,php_if_md5_file, arginfo_md5_file)
  2216. PHP_NAMED_FE(crc32,php_if_crc32, arginfo_crc32)
  2217. PHP_FE(iptcparse, arginfo_iptcparse)
  2218. PHP_FE(iptcembed, arginfo_iptcembed)
  2219. PHP_FE(getimagesize, arginfo_getimagesize)
  2220. PHP_FE(getimagesizefromstring, arginfo_getimagesize)
  2221. PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type)
  2222. PHP_FE(image_type_to_extension, arginfo_image_type_to_extension)
  2223. PHP_FE(phpinfo, arginfo_phpinfo)
  2224. PHP_FE(phpversion, arginfo_phpversion)
  2225. PHP_FE(phpcredits, arginfo_phpcredits)
  2226. PHP_FE(php_sapi_name, arginfo_php_sapi_name)
  2227. PHP_FE(php_uname, arginfo_php_uname)
  2228. PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
  2229. PHP_FE(php_ini_loaded_file, arginfo_php_ini_loaded_file)
  2230. PHP_FE(strnatcmp, arginfo_strnatcmp)
  2231. PHP_FE(strnatcasecmp, arginfo_strnatcasecmp)
  2232. PHP_FE(substr_count, arginfo_substr_count)
  2233. PHP_FE(strspn, arginfo_strspn)
  2234. PHP_FE(strcspn, arginfo_strcspn)
  2235. PHP_FE(strtok, arginfo_strtok)
  2236. PHP_FE(strtoupper, arginfo_strtoupper)
  2237. PHP_FE(strtolower, arginfo_strtolower)
  2238. PHP_FE(strpos, arginfo_strpos)
  2239. PHP_FE(stripos, arginfo_stripos)
  2240. PHP_FE(strrpos, arginfo_strrpos)
  2241. PHP_FE(strripos, arginfo_strripos)
  2242. PHP_FE(strrev, arginfo_strrev)
  2243. PHP_FE(hebrev, arginfo_hebrev)
  2244. PHP_FE(hebrevc, arginfo_hebrevc)
  2245. PHP_FE(nl2br, arginfo_nl2br)
  2246. PHP_FE(basename, arginfo_basename)
  2247. PHP_FE(dirname, arginfo_dirname)
  2248. PHP_FE(pathinfo, arginfo_pathinfo)
  2249. PHP_FE(stripslashes, arginfo_stripslashes)
  2250. PHP_FE(stripcslashes, arginfo_stripcslashes)
  2251. PHP_FE(strstr, arginfo_strstr)
  2252. PHP_FE(stristr, arginfo_stristr)
  2253. PHP_FE(strrchr, arginfo_strrchr)
  2254. PHP_FE(str_shuffle, arginfo_str_shuffle)
  2255. PHP_FE(str_word_count, arginfo_str_word_count)
  2256. PHP_FE(str_split, arginfo_str_split)
  2257. PHP_FE(strpbrk, arginfo_strpbrk)
  2258. PHP_FE(substr_compare, arginfo_substr_compare)
  2259. #ifdef HAVE_STRCOLL
  2260. PHP_FE(strcoll, arginfo_strcoll)
  2261. #endif
  2262. #ifdef HAVE_STRFMON
  2263. PHP_FE(money_format, arginfo_money_format)
  2264. #endif
  2265. PHP_FE(substr, arginfo_substr)
  2266. PHP_FE(substr_replace, arginfo_substr_replace)
  2267. PHP_FE(quotemeta, arginfo_quotemeta)
  2268. PHP_FE(ucfirst, arginfo_ucfirst)
  2269. PHP_FE(lcfirst, arginfo_lcfirst)
  2270. PHP_FE(ucwords, arginfo_ucwords)
  2271. PHP_FE(strtr, arginfo_strtr)
  2272. PHP_FE(addslashes, arginfo_addslashes)
  2273. PHP_FE(addcslashes, arginfo_addcslashes)
  2274. PHP_FE(rtrim, arginfo_rtrim)
  2275. PHP_FE(str_replace, arginfo_str_replace)
  2276. PHP_FE(str_ireplace, arginfo_str_ireplace)
  2277. PHP_FE(str_repeat, arginfo_str_repeat)
  2278. PHP_FE(count_chars, arginfo_count_chars)
  2279. PHP_FE(chunk_split, arginfo_chunk_split)
  2280. PHP_FE(trim, arginfo_trim)
  2281. PHP_FE(ltrim, arginfo_ltrim)
  2282. PHP_FE(strip_tags, arginfo_strip_tags)
  2283. PHP_FE(similar_text, arginfo_similar_text)
  2284. PHP_FE(explode, arginfo_explode)
  2285. PHP_FE(implode, arginfo_implode)
  2286. PHP_FALIAS(join, implode, arginfo_implode)
  2287. PHP_FE(setlocale, arginfo_setlocale)
  2288. PHP_FE(localeconv, arginfo_localeconv)
  2289. #if HAVE_NL_LANGINFO
  2290. PHP_FE(nl_langinfo, arginfo_nl_langinfo)
  2291. #endif
  2292. PHP_FE(soundex, arginfo_soundex)
  2293. PHP_FE(levenshtein, arginfo_levenshtein)
  2294. PHP_FE(chr, arginfo_chr)
  2295. PHP_FE(ord, arginfo_ord)
  2296. PHP_FE(parse_str, arginfo_parse_str)
  2297. PHP_FE(str_getcsv, arginfo_str_getcsv)
  2298. PHP_FE(str_pad, arginfo_str_pad)
  2299. PHP_FALIAS(chop, rtrim, arginfo_rtrim)
  2300. PHP_FALIAS(strchr, strstr, arginfo_strstr)
  2301. PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), arginfo_sprintf)
  2302. PHP_NAMED_FE(printf, PHP_FN(user_printf), arginfo_printf)
  2303. PHP_FE(vprintf, arginfo_vprintf)
  2304. PHP_FE(vsprintf, arginfo_vsprintf)
  2305. PHP_FE(fprintf, arginfo_fprintf)
  2306. PHP_FE(vfprintf, arginfo_vfprintf)
  2307. PHP_FE(sscanf, arginfo_sscanf)
  2308. PHP_FE(fscanf, arginfo_fscanf)
  2309. PHP_FE(parse_url, arginfo_parse_url)
  2310. PHP_FE(urlencode, arginfo_urlencode)
  2311. PHP_FE(urldecode, arginfo_urldecode)
  2312. PHP_FE(rawurlencode, arginfo_rawurlencode)
  2313. PHP_FE(rawurldecode, arginfo_rawurldecode)
  2314. PHP_FE(http_build_query, arginfo_http_build_query)
  2315. #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
  2316. PHP_FE(readlink, arginfo_readlink)
  2317. PHP_FE(linkinfo, arginfo_linkinfo)
  2318. PHP_FE(symlink, arginfo_symlink)
  2319. PHP_FE(link, arginfo_link)
  2320. #endif
  2321. PHP_FE(unlink, arginfo_unlink)
  2322. PHP_FE(exec, arginfo_exec)
  2323. PHP_FE(system, arginfo_system)
  2324. PHP_FE(escapeshellcmd, arginfo_escapeshellcmd)
  2325. PHP_FE(escapeshellarg, arginfo_escapeshellarg)
  2326. PHP_FE(passthru, arginfo_passthru)
  2327. PHP_FE(shell_exec, arginfo_shell_exec)
  2328. #ifdef PHP_CAN_SUPPORT_PROC_OPEN
  2329. PHP_FE(proc_open, arginfo_proc_open)
  2330. PHP_FE(proc_close, arginfo_proc_close)
  2331. PHP_FE(proc_terminate, arginfo_proc_terminate)
  2332. PHP_FE(proc_get_status, arginfo_proc_get_status)
  2333. #endif
  2334. #ifdef HAVE_NICE
  2335. PHP_FE(proc_nice, arginfo_proc_nice)
  2336. #endif
  2337. PHP_FE(rand, arginfo_rand)
  2338. PHP_FE(srand, arginfo_srand)
  2339. PHP_FE(getrandmax, arginfo_getrandmax)
  2340. PHP_FE(mt_rand, arginfo_mt_rand)
  2341. PHP_FE(mt_srand, arginfo_mt_srand)
  2342. PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
  2343. #if HAVE_GETSERVBYNAME
  2344. PHP_FE(getservbyname, arginfo_getservbyname)
  2345. #endif
  2346. #if HAVE_GETSERVBYPORT
  2347. PHP_FE(getservbyport, arginfo_getservbyport)
  2348. #endif
  2349. #if HAVE_GETPROTOBYNAME
  2350. PHP_FE(getprotobyname, arginfo_getprotobyname)
  2351. #endif
  2352. #if HAVE_GETPROTOBYNUMBER
  2353. PHP_FE(getprotobynumber, arginfo_getprotobynumber)
  2354. #endif
  2355. PHP_FE(getmyuid, arginfo_getmyuid)
  2356. PHP_FE(getmygid, arginfo_getmygid)
  2357. PHP_FE(getmypid, arginfo_getmypid)
  2358. PHP_FE(getmyinode, arginfo_getmyinode)
  2359. PHP_FE(getlastmod, arginfo_getlastmod)
  2360. PHP_FE(base64_decode, arginfo_base64_decode)
  2361. PHP_FE(base64_encode, arginfo_base64_encode)
  2362. PHP_FE(password_hash, arginfo_password_hash)
  2363. PHP_FE(password_get_info, arginfo_password_get_info)
  2364. PHP_FE(password_needs_rehash, arginfo_password_needs_rehash)
  2365. PHP_FE(password_verify, arginfo_password_verify)
  2366. PHP_FE(convert_uuencode, arginfo_convert_uuencode)
  2367. PHP_FE(convert_uudecode, arginfo_convert_uudecode)
  2368. PHP_FE(abs, arginfo_abs)
  2369. PHP_FE(ceil, arginfo_ceil)
  2370. PHP_FE(floor, arginfo_floor)
  2371. PHP_FE(round, arginfo_round)
  2372. PHP_FE(sin, arginfo_sin)
  2373. PHP_FE(cos, arginfo_cos)
  2374. PHP_FE(tan, arginfo_tan)
  2375. PHP_FE(asin, arginfo_asin)
  2376. PHP_FE(acos, arginfo_acos)
  2377. PHP_FE(atan, arginfo_atan)
  2378. PHP_FE(atanh, arginfo_atanh)
  2379. PHP_FE(atan2, arginfo_atan2)
  2380. PHP_FE(sinh, arginfo_sinh)
  2381. PHP_FE(cosh, arginfo_cosh)
  2382. PHP_FE(tanh, arginfo_tanh)
  2383. PHP_FE(asinh, arginfo_asinh)
  2384. PHP_FE(acosh, arginfo_acosh)
  2385. PHP_FE(expm1, arginfo_expm1)
  2386. PHP_FE(log1p, arginfo_log1p)
  2387. PHP_FE(pi, arginfo_pi)
  2388. PHP_FE(is_finite, arginfo_is_finite)
  2389. PHP_FE(is_nan, arginfo_is_nan)
  2390. PHP_FE(is_infinite, arginfo_is_infinite)
  2391. PHP_FE(pow, arginfo_pow)
  2392. PHP_FE(exp, arginfo_exp)
  2393. PHP_FE(log, arginfo_log)
  2394. PHP_FE(log10, arginfo_log10)
  2395. PHP_FE(sqrt, arginfo_sqrt)
  2396. PHP_FE(hypot, arginfo_hypot)
  2397. PHP_FE(deg2rad, arginfo_deg2rad)
  2398. PHP_FE(rad2deg, arginfo_rad2deg)
  2399. PHP_FE(bindec, arginfo_bindec)
  2400. PHP_FE(hexdec, arginfo_hexdec)
  2401. PHP_FE(octdec, arginfo_octdec)
  2402. PHP_FE(decbin, arginfo_decbin)
  2403. PHP_FE(decoct, arginfo_decoct)
  2404. PHP_FE(dechex, arginfo_dechex)
  2405. PHP_FE(base_convert, arginfo_base_convert)
  2406. PHP_FE(number_format, arginfo_number_format)
  2407. PHP_FE(fmod, arginfo_fmod)
  2408. #ifdef HAVE_INET_NTOP
  2409. PHP_RAW_NAMED_FE(inet_ntop, php_inet_ntop, arginfo_inet_ntop)
  2410. #endif
  2411. #ifdef HAVE_INET_PTON
  2412. PHP_RAW_NAMED_FE(inet_pton, php_inet_pton, arginfo_inet_pton)
  2413. #endif
  2414. PHP_FE(ip2long, arginfo_ip2long)
  2415. PHP_FE(long2ip, arginfo_long2ip)
  2416. PHP_FE(getenv, arginfo_getenv)
  2417. #ifdef HAVE_PUTENV
  2418. PHP_FE(putenv, arginfo_putenv)
  2419. #endif
  2420. PHP_FE(getopt, arginfo_getopt)
  2421. #ifdef HAVE_GETLOADAVG
  2422. PHP_FE(sys_getloadavg, arginfo_sys_getloadavg)
  2423. #endif
  2424. #ifdef HAVE_GETTIMEOFDAY
  2425. PHP_FE(microtime, arginfo_microtime)
  2426. PHP_FE(gettimeofday, arginfo_gettimeofday)
  2427. #endif
  2428. #ifdef HAVE_GETRUSAGE
  2429. PHP_FE(getrusage, arginfo_getrusage)
  2430. #endif
  2431. #ifdef HAVE_GETTIMEOFDAY
  2432. PHP_FE(uniqid, arginfo_uniqid)
  2433. #endif
  2434. PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
  2435. PHP_FE(quoted_printable_encode, arginfo_quoted_printable_encode)
  2436. PHP_FE(convert_cyr_string, arginfo_convert_cyr_string)
  2437. PHP_FE(get_current_user, arginfo_get_current_user)
  2438. PHP_FE(set_time_limit, arginfo_set_time_limit)
  2439. PHP_FE(header_register_callback, arginfo_header_register_callback)
  2440. PHP_FE(get_cfg_var, arginfo_get_cfg_var)
  2441. PHP_DEP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, arginfo_set_magic_quotes_runtime)
  2442. PHP_DEP_FE(set_magic_quotes_runtime, arginfo_set_magic_quotes_runtime)
  2443. PHP_FE(get_magic_quotes_gpc, arginfo_get_magic_quotes_gpc)
  2444. PHP_FE(get_magic_quotes_runtime, arginfo_get_magic_quotes_runtime)
  2445. PHP_FE(error_log, arginfo_error_log)
  2446. PHP_FE(error_get_last, arginfo_error_get_last)
  2447. PHP_FE(call_user_func, arginfo_call_user_func)
  2448. PHP_FE(call_user_func_array, arginfo_call_user_func_array)
  2449. PHP_DEP_FE(call_user_method, arginfo_call_user_method)
  2450. PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array)
  2451. PHP_FE(forward_static_call, arginfo_forward_static_call)
  2452. PHP_FE(forward_static_call_array, arginfo_forward_static_call_array)
  2453. PHP_FE(serialize, arginfo_serialize)
  2454. PHP_FE(unserialize, arginfo_unserialize)
  2455. PHP_FE(var_dump, arginfo_var_dump)
  2456. PHP_FE(var_export, arginfo_var_export)
  2457. PHP_FE(debug_zval_dump, arginfo_debug_zval_dump)
  2458. PHP_FE(print_r, arginfo_print_r)
  2459. PHP_FE(memory_get_usage, arginfo_memory_get_usage)
  2460. PHP_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage)
  2461. PHP_FE(register_shutdown_function, arginfo_register_shutdown_function)
  2462. PHP_FE(register_tick_function, arginfo_register_tick_function)
  2463. PHP_FE(unregister_tick_function, arginfo_unregister_tick_function)
  2464. PHP_FE(highlight_file, arginfo_highlight_file)
  2465. PHP_FALIAS(show_source, highlight_file, arginfo_highlight_file)
  2466. PHP_FE(highlight_string, arginfo_highlight_string)
  2467. PHP_FE(php_strip_whitespace, arginfo_php_strip_whitespace)
  2468. PHP_FE(ini_get, arginfo_ini_get)
  2469. PHP_FE(ini_get_all, arginfo_ini_get_all)
  2470. PHP_FE(ini_set, arginfo_ini_set)
  2471. PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set)
  2472. PHP_FE(ini_restore, arginfo_ini_restore)
  2473. PHP_FE(get_include_path, arginfo_get_include_path)
  2474. PHP_FE(set_include_path, arginfo_set_include_path)
  2475. PHP_FE(restore_include_path, arginfo_restore_include_path)
  2476. PHP_FE(setcookie, arginfo_setcookie)
  2477. PHP_FE(setrawcookie, arginfo_setrawcookie)
  2478. PHP_FE(header, arginfo_header)
  2479. PHP_FE(header_remove, arginfo_header_remove)
  2480. PHP_FE(headers_sent, arginfo_headers_sent)
  2481. PHP_FE(headers_list, arginfo_headers_list)
  2482. PHP_FE(http_response_code, arginfo_http_response_code)
  2483. PHP_FE(connection_aborted, arginfo_connection_aborted)
  2484. PHP_FE(connection_status, arginfo_connection_status)
  2485. PHP_FE(ignore_user_abort, arginfo_ignore_user_abort)
  2486. PHP_FE(parse_ini_file, arginfo_parse_ini_file)
  2487. PHP_FE(parse_ini_string, arginfo_parse_ini_string)
  2488. #if ZEND_DEBUG
  2489. PHP_FE(config_get_hash, arginfo_config_get_hash)
  2490. #endif
  2491. PHP_FE(is_uploaded_file, arginfo_is_uploaded_file)
  2492. PHP_FE(move_uploaded_file, arginfo_move_uploaded_file)
  2493. /* functions from dns.c */
  2494. PHP_FE(gethostbyaddr, arginfo_gethostbyaddr)
  2495. PHP_FE(gethostbyname, arginfo_gethostbyname)
  2496. PHP_FE(gethostbynamel, arginfo_gethostbynamel)
  2497. #ifdef HAVE_GETHOSTNAME
  2498. PHP_FE(gethostname, arginfo_gethostname)
  2499. #endif
  2500. #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
  2501. PHP_FE(dns_check_record, arginfo_dns_check_record)
  2502. PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
  2503. # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
  2504. PHP_FE(dns_get_mx, arginfo_dns_get_mx)
  2505. PHP_FALIAS(getmxrr, dns_get_mx, arginfo_dns_get_mx)
  2506. PHP_FE(dns_get_record, arginfo_dns_get_record)
  2507. # endif
  2508. #endif
  2509. /* functions from type.c */
  2510. PHP_FE(intval, arginfo_intval)
  2511. PHP_FE(floatval, arginfo_floatval)
  2512. PHP_FALIAS(doubleval, floatval, arginfo_floatval)
  2513. PHP_FE(strval, arginfo_strval)
  2514. PHP_FE(boolval, arginfo_boolval)
  2515. PHP_FE(gettype, arginfo_gettype)
  2516. PHP_FE(settype, arginfo_settype)
  2517. PHP_FE(is_null, arginfo_is_null)
  2518. PHP_FE(is_resource, arginfo_is_resource)
  2519. PHP_FE(is_bool, arginfo_is_bool)
  2520. PHP_FE(is_long, arginfo_is_long)
  2521. PHP_FE(is_float, arginfo_is_float)
  2522. PHP_FALIAS(is_int, is_long, arginfo_is_long)
  2523. PHP_FALIAS(is_integer, is_long, arginfo_is_long)
  2524. PHP_FALIAS(is_double, is_float, arginfo_is_float)
  2525. PHP_FALIAS(is_real, is_float, arginfo_is_float)
  2526. PHP_FE(is_numeric, arginfo_is_numeric)
  2527. PHP_FE(is_string, arginfo_is_string)
  2528. PHP_FE(is_array, arginfo_is_array)
  2529. PHP_FE(is_object, arginfo_is_object)
  2530. PHP_FE(is_scalar, arginfo_is_scalar)
  2531. PHP_FE(is_callable, arginfo_is_callable)
  2532. /* functions from file.c */
  2533. PHP_FE(pclose, arginfo_pclose)
  2534. PHP_FE(popen, arginfo_popen)
  2535. PHP_FE(readfile, arginfo_readfile)
  2536. PHP_FE(rewind, arginfo_rewind)
  2537. PHP_FE(rmdir, arginfo_rmdir)
  2538. PHP_FE(umask, arginfo_umask)
  2539. PHP_FE(fclose, arginfo_fclose)
  2540. PHP_FE(feof, arginfo_feof)
  2541. PHP_FE(fgetc, arginfo_fgetc)
  2542. PHP_FE(fgets, arginfo_fgets)
  2543. PHP_FE(fgetss, arginfo_fgetss)
  2544. PHP_FE(fread, arginfo_fread)
  2545. PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen)
  2546. PHP_FE(fpassthru, arginfo_fpassthru)
  2547. PHP_NAMED_FE(ftruncate, php_if_ftruncate, arginfo_ftruncate)
  2548. PHP_NAMED_FE(fstat, php_if_fstat, arginfo_fstat)
  2549. PHP_FE(fseek, arginfo_fseek)
  2550. PHP_FE(ftell, arginfo_ftell)
  2551. PHP_FE(fflush, arginfo_fflush)
  2552. PHP_FE(fwrite, arginfo_fwrite)
  2553. PHP_FALIAS(fputs, fwrite, arginfo_fwrite)
  2554. PHP_FE(mkdir, arginfo_mkdir)
  2555. PHP_FE(rename, arginfo_rename)
  2556. PHP_FE(copy, arginfo_copy)
  2557. PHP_FE(tempnam, arginfo_tempnam)
  2558. PHP_NAMED_FE(tmpfile, php_if_tmpfile, arginfo_tmpfile)
  2559. PHP_FE(file, arginfo_file)
  2560. PHP_FE(file_get_contents, arginfo_file_get_contents)
  2561. PHP_FE(file_put_contents, arginfo_file_put_contents)
  2562. PHP_FE(stream_select, arginfo_stream_select)
  2563. PHP_FE(stream_context_create, arginfo_stream_context_create)
  2564. PHP_FE(stream_context_set_params, arginfo_stream_context_set_params)
  2565. PHP_FE(stream_context_get_params, arginfo_stream_context_get_params)
  2566. PHP_FE(stream_context_set_option, arginfo_stream_context_set_option)
  2567. PHP_FE(stream_context_get_options, arginfo_stream_context_get_options)
  2568. PHP_FE(stream_context_get_default, arginfo_stream_context_get_default)
  2569. PHP_FE(stream_context_set_default, arginfo_stream_context_set_default)
  2570. PHP_FE(stream_filter_prepend, arginfo_stream_filter_prepend)
  2571. PHP_FE(stream_filter_append, arginfo_stream_filter_append)
  2572. PHP_FE(stream_filter_remove, arginfo_stream_filter_remove)
  2573. PHP_FE(stream_socket_client, arginfo_stream_socket_client)
  2574. PHP_FE(stream_socket_server, arginfo_stream_socket_server)
  2575. PHP_FE(stream_socket_accept, arginfo_stream_socket_accept)
  2576. PHP_FE(stream_socket_get_name, arginfo_stream_socket_get_name)
  2577. PHP_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom)
  2578. PHP_FE(stream_socket_sendto, arginfo_stream_socket_sendto)
  2579. PHP_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto)
  2580. #ifdef HAVE_SHUTDOWN
  2581. PHP_FE(stream_socket_shutdown, arginfo_stream_socket_shutdown)
  2582. #endif
  2583. #if HAVE_SOCKETPAIR
  2584. PHP_FE(stream_socket_pair, arginfo_stream_socket_pair)
  2585. #endif
  2586. PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream)
  2587. PHP_FE(stream_get_contents, arginfo_stream_get_contents)
  2588. PHP_FE(stream_supports_lock, arginfo_stream_supports_lock)
  2589. PHP_FE(fgetcsv, arginfo_fgetcsv)
  2590. PHP_FE(fputcsv, arginfo_fputcsv)
  2591. PHP_FE(flock, arginfo_flock)
  2592. PHP_FE(get_meta_tags, arginfo_get_meta_tags)
  2593. PHP_FE(stream_set_read_buffer, arginfo_stream_set_read_buffer)
  2594. PHP_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer)
  2595. PHP_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_stream_set_write_buffer)
  2596. PHP_FE(stream_set_chunk_size, arginfo_stream_set_chunk_size)
  2597. PHP_DEP_FALIAS(set_socket_blocking, stream_set_blocking, arginfo_stream_set_blocking)
  2598. PHP_FE(stream_set_blocking, arginfo_stream_set_blocking)
  2599. PHP_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_stream_set_blocking)
  2600. PHP_FE(stream_get_meta_data, arginfo_stream_get_meta_data)
  2601. PHP_FE(stream_get_line, arginfo_stream_get_line)
  2602. PHP_FE(stream_wrapper_register, arginfo_stream_wrapper_register)
  2603. PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_wrapper_register)
  2604. PHP_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister)
  2605. PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore)
  2606. PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers)
  2607. PHP_FE(stream_get_transports, arginfo_stream_get_transports)
  2608. PHP_FE(stream_resolve_include_path, arginfo_stream_resolve_include_path)
  2609. PHP_FE(stream_is_local, arginfo_stream_is_local)
  2610. PHP_FE(get_headers, arginfo_get_headers)
  2611. #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
  2612. PHP_FE(stream_set_timeout, arginfo_stream_set_timeout)
  2613. PHP_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_stream_set_timeout)
  2614. #endif
  2615. PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
  2616. #if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
  2617. PHP_FE(realpath, arginfo_realpath)
  2618. #endif
  2619. #ifdef HAVE_FNMATCH
  2620. PHP_FE(fnmatch, arginfo_fnmatch)
  2621. #endif
  2622. /* functions from fsock.c */
  2623. PHP_FE(fsockopen, arginfo_fsockopen)
  2624. PHP_FE(pfsockopen, arginfo_pfsockopen)
  2625. /* functions from pack.c */
  2626. PHP_FE(pack, arginfo_pack)
  2627. PHP_FE(unpack, arginfo_unpack)
  2628. /* functions from browscap.c */
  2629. PHP_FE(get_browser, arginfo_get_browser)
  2630. #if HAVE_CRYPT
  2631. /* functions from crypt.c */
  2632. PHP_FE(crypt, arginfo_crypt)
  2633. #endif
  2634. /* functions from dir.c */
  2635. PHP_FE(opendir, arginfo_opendir)
  2636. PHP_FE(closedir, arginfo_closedir)
  2637. PHP_FE(chdir, arginfo_chdir)
  2638. #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
  2639. PHP_FE(chroot, arginfo_chroot)
  2640. #endif
  2641. PHP_FE(getcwd, arginfo_getcwd)
  2642. PHP_FE(rewinddir, arginfo_rewinddir)
  2643. PHP_NAMED_FE(readdir, php_if_readdir, arginfo_readdir)
  2644. PHP_FALIAS(dir, getdir, arginfo_dir)
  2645. PHP_FE(scandir, arginfo_scandir)
  2646. #ifdef HAVE_GLOB
  2647. PHP_FE(glob, arginfo_glob)
  2648. #endif
  2649. /* functions from filestat.c */
  2650. PHP_FE(fileatime, arginfo_fileatime)
  2651. PHP_FE(filectime, arginfo_filectime)
  2652. PHP_FE(filegroup, arginfo_filegroup)
  2653. PHP_FE(fileinode, arginfo_fileinode)
  2654. PHP_FE(filemtime, arginfo_filemtime)
  2655. PHP_FE(fileowner, arginfo_fileowner)
  2656. PHP_FE(fileperms, arginfo_fileperms)
  2657. PHP_FE(filesize, arginfo_filesize)
  2658. PHP_FE(filetype, arginfo_filetype)
  2659. PHP_FE(file_exists, arginfo_file_exists)
  2660. PHP_FE(is_writable, arginfo_is_writable)
  2661. PHP_FALIAS(is_writeable, is_writable, arginfo_is_writable)
  2662. PHP_FE(is_readable, arginfo_is_readable)
  2663. PHP_FE(is_executable, arginfo_is_executable)
  2664. PHP_FE(is_file, arginfo_is_file)
  2665. PHP_FE(is_dir, arginfo_is_dir)
  2666. PHP_FE(is_link, arginfo_is_link)
  2667. PHP_NAMED_FE(stat, php_if_stat, arginfo_stat)
  2668. PHP_NAMED_FE(lstat, php_if_lstat, arginfo_lstat)
  2669. #ifndef NETWARE
  2670. PHP_FE(chown, arginfo_chown)
  2671. PHP_FE(chgrp, arginfo_chgrp)
  2672. #endif
  2673. #if HAVE_LCHOWN
  2674. PHP_FE(lchown, arginfo_lchown)
  2675. #endif
  2676. #if HAVE_LCHOWN
  2677. PHP_FE(lchgrp, arginfo_lchgrp)
  2678. #endif
  2679. PHP_FE(chmod, arginfo_chmod)
  2680. #if HAVE_UTIME
  2681. PHP_FE(touch, arginfo_touch)
  2682. #endif
  2683. PHP_FE(clearstatcache, arginfo_clearstatcache)
  2684. PHP_FE(disk_total_space, arginfo_disk_total_space)
  2685. PHP_FE(disk_free_space, arginfo_disk_free_space)
  2686. PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
  2687. PHP_FE(realpath_cache_size, arginfo_realpath_cache_size)
  2688. PHP_FE(realpath_cache_get, arginfo_realpath_cache_get)
  2689. /* functions from mail.c */
  2690. PHP_FE(mail, arginfo_mail)
  2691. PHP_FE(ezmlm_hash, arginfo_ezmlm_hash)
  2692. /* functions from syslog.c */
  2693. #ifdef HAVE_SYSLOG_H
  2694. PHP_FE(openlog, arginfo_openlog)
  2695. PHP_FE(syslog, arginfo_syslog)
  2696. PHP_FE(closelog, arginfo_closelog)
  2697. #endif
  2698. /* functions from lcg.c */
  2699. PHP_FE(lcg_value, arginfo_lcg_value)
  2700. /* functions from metaphone.c */
  2701. PHP_FE(metaphone, arginfo_metaphone)
  2702. /* functions from output.c */
  2703. PHP_FE(ob_start, arginfo_ob_start)
  2704. PHP_FE(ob_flush, arginfo_ob_flush)
  2705. PHP_FE(ob_clean, arginfo_ob_clean)
  2706. PHP_FE(ob_end_flush, arginfo_ob_end_flush)
  2707. PHP_FE(ob_end_clean, arginfo_ob_end_clean)
  2708. PHP_FE(ob_get_flush, arginfo_ob_get_flush)
  2709. PHP_FE(ob_get_clean, arginfo_ob_get_clean)
  2710. PHP_FE(ob_get_length, arginfo_ob_get_length)
  2711. PHP_FE(ob_get_level, arginfo_ob_get_level)
  2712. PHP_FE(ob_get_status, arginfo_ob_get_status)
  2713. PHP_FE(ob_get_contents, arginfo_ob_get_contents)
  2714. PHP_FE(ob_implicit_flush, arginfo_ob_implicit_flush)
  2715. PHP_FE(ob_list_handlers, arginfo_ob_list_handlers)
  2716. /* functions from array.c */
  2717. PHP_FE(ksort, arginfo_ksort)
  2718. PHP_FE(krsort, arginfo_krsort)
  2719. PHP_FE(natsort, arginfo_natsort)
  2720. PHP_FE(natcasesort, arginfo_natcasesort)
  2721. PHP_FE(asort, arginfo_asort)
  2722. PHP_FE(arsort, arginfo_arsort)
  2723. PHP_FE(sort, arginfo_sort)
  2724. PHP_FE(rsort, arginfo_rsort)
  2725. PHP_FE(usort, arginfo_usort)
  2726. PHP_FE(uasort, arginfo_uasort)
  2727. PHP_FE(uksort, arginfo_uksort)
  2728. PHP_FE(shuffle, arginfo_shuffle)
  2729. PHP_FE(array_walk, arginfo_array_walk)
  2730. PHP_FE(array_walk_recursive, arginfo_array_walk_recursive)
  2731. PHP_FE(count, arginfo_count)
  2732. PHP_FE(end, arginfo_end)
  2733. PHP_FE(prev, arginfo_prev)
  2734. PHP_FE(next, arginfo_next)
  2735. PHP_FE(reset, arginfo_reset)
  2736. PHP_FE(current, arginfo_current)
  2737. PHP_FE(key, arginfo_key)
  2738. PHP_FE(min, arginfo_min)
  2739. PHP_FE(max, arginfo_max)
  2740. PHP_FE(in_array, arginfo_in_array)
  2741. PHP_FE(array_search, arginfo_array_search)
  2742. PHP_FE(extract, arginfo_extract)
  2743. PHP_FE(compact, arginfo_compact)
  2744. PHP_FE(array_fill, arginfo_array_fill)
  2745. PHP_FE(array_fill_keys, arginfo_array_fill_keys)
  2746. PHP_FE(range, arginfo_range)
  2747. PHP_FE(array_multisort, arginfo_array_multisort)
  2748. PHP_FE(array_push, arginfo_array_push)
  2749. PHP_FE(array_pop, arginfo_array_pop)
  2750. PHP_FE(array_shift, arginfo_array_shift)
  2751. PHP_FE(array_unshift, arginfo_array_unshift)
  2752. PHP_FE(array_splice, arginfo_array_splice)
  2753. PHP_FE(array_slice, arginfo_array_slice)
  2754. PHP_FE(array_merge, arginfo_array_merge)
  2755. PHP_FE(array_merge_recursive, arginfo_array_merge_recursive)
  2756. PHP_FE(array_replace, arginfo_array_replace)
  2757. PHP_FE(array_replace_recursive, arginfo_array_replace_recursive)
  2758. PHP_FE(array_keys, arginfo_array_keys)
  2759. PHP_FE(array_values, arginfo_array_values)
  2760. PHP_FE(array_count_values, arginfo_array_count_values)
  2761. PHP_FE(array_column, arginfo_array_column)
  2762. PHP_FE(array_reverse, arginfo_array_reverse)
  2763. PHP_FE(array_reduce, arginfo_array_reduce)
  2764. PHP_FE(array_pad, arginfo_array_pad)
  2765. PHP_FE(array_flip, arginfo_array_flip)
  2766. PHP_FE(array_change_key_case, arginfo_array_change_key_case)
  2767. PHP_FE(array_rand, arginfo_array_rand)
  2768. PHP_FE(array_unique, arginfo_array_unique)
  2769. PHP_FE(array_intersect, arginfo_array_intersect)
  2770. PHP_FE(array_intersect_key, arginfo_array_intersect_key)
  2771. PHP_FE(array_intersect_ukey, arginfo_array_intersect_ukey)
  2772. PHP_FE(array_uintersect, arginfo_array_uintersect)
  2773. PHP_FE(array_intersect_assoc, arginfo_array_intersect_assoc)
  2774. PHP_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc)
  2775. PHP_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc)
  2776. PHP_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc)
  2777. PHP_FE(array_diff, arginfo_array_diff)
  2778. PHP_FE(array_diff_key, arginfo_array_diff_key)
  2779. PHP_FE(array_diff_ukey, arginfo_array_diff_ukey)
  2780. PHP_FE(array_udiff, arginfo_array_udiff)
  2781. PHP_FE(array_diff_assoc, arginfo_array_diff_assoc)
  2782. PHP_FE(array_udiff_assoc, arginfo_array_udiff_assoc)
  2783. PHP_FE(array_diff_uassoc, arginfo_array_diff_uassoc)
  2784. PHP_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc)
  2785. PHP_FE(array_sum, arginfo_array_sum)
  2786. PHP_FE(array_product, arginfo_array_product)
  2787. PHP_FE(array_filter, arginfo_array_filter)
  2788. PHP_FE(array_map, arginfo_array_map)
  2789. PHP_FE(array_chunk, arginfo_array_chunk)
  2790. PHP_FE(array_combine, arginfo_array_combine)
  2791. PHP_FE(array_key_exists, arginfo_array_key_exists)
  2792. /* aliases from array.c */
  2793. PHP_FALIAS(pos, current, arginfo_current)
  2794. PHP_FALIAS(sizeof, count, arginfo_count)
  2795. PHP_FALIAS(key_exists, array_key_exists, arginfo_array_key_exists)
  2796. /* functions from assert.c */
  2797. PHP_FE(assert, arginfo_assert)
  2798. PHP_FE(assert_options, arginfo_assert_options)
  2799. /* functions from versioning.c */
  2800. PHP_FE(version_compare, arginfo_version_compare)
  2801. /* functions from ftok.c*/
  2802. #if HAVE_FTOK
  2803. PHP_FE(ftok, arginfo_ftok)
  2804. #endif
  2805. PHP_FE(str_rot13, arginfo_str_rot13)
  2806. PHP_FE(stream_get_filters, arginfo_stream_get_filters)
  2807. PHP_FE(stream_filter_register, arginfo_stream_filter_register)
  2808. PHP_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable)
  2809. PHP_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend)
  2810. PHP_FE(stream_bucket_append, arginfo_stream_bucket_append)
  2811. PHP_FE(stream_bucket_new, arginfo_stream_bucket_new)
  2812. PHP_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var)
  2813. PHP_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars)
  2814. PHP_FE(sys_get_temp_dir, arginfo_sys_get_temp_dir)
  2815. PHP_FE_END
  2816. };
  2817. /* }}} */
  2818. static const zend_module_dep standard_deps[] = { /* {{{ */
  2819. ZEND_MOD_OPTIONAL("session")
  2820. ZEND_MOD_END
  2821. };
  2822. /* }}} */
  2823. zend_module_entry basic_functions_module = { /* {{{ */
  2824. STANDARD_MODULE_HEADER_EX,
  2825. NULL,
  2826. standard_deps,
  2827. "standard", /* extension name */
  2828. basic_functions, /* function list */
  2829. PHP_MINIT(basic), /* process startup */
  2830. PHP_MSHUTDOWN(basic), /* process shutdown */
  2831. PHP_RINIT(basic), /* request startup */
  2832. PHP_RSHUTDOWN(basic), /* request shutdown */
  2833. PHP_MINFO(basic), /* extension info */
  2834. PHP_VERSION, /* extension version */
  2835. STANDARD_MODULE_PROPERTIES
  2836. };
  2837. /* }}} */
  2838. #if defined(HAVE_PUTENV)
  2839. static void php_putenv_destructor(putenv_entry *pe) /* {{{ */
  2840. {
  2841. if (pe->previous_value) {
  2842. #if _MSC_VER >= 1300
  2843. /* VS.Net has a bug in putenv() when setting a variable that
  2844. * is already set; if the SetEnvironmentVariable() API call
  2845. * fails, the Crt will double free() a string.
  2846. * We try to avoid this by setting our own value first */
  2847. SetEnvironmentVariable(pe->key, "bugbug");
  2848. #endif
  2849. putenv(pe->previous_value);
  2850. # if defined(PHP_WIN32)
  2851. efree(pe->previous_value);
  2852. # endif
  2853. } else {
  2854. # if HAVE_UNSETENV
  2855. unsetenv(pe->key);
  2856. # elif defined(PHP_WIN32)
  2857. SetEnvironmentVariable(pe->key, NULL);
  2858. # ifndef ZTS
  2859. _putenv_s(pe->key, "");
  2860. # endif
  2861. # else
  2862. char **env;
  2863. for (env = environ; env != NULL && *env != NULL; env++) {
  2864. if (!strncmp(*env, pe->key, pe->key_len) && (*env)[pe->key_len] == '=') { /* found it */
  2865. *env = "";
  2866. break;
  2867. }
  2868. }
  2869. # endif
  2870. }
  2871. #ifdef HAVE_TZSET
  2872. /* don't forget to reset the various libc globals that
  2873. * we might have changed by an earlier call to tzset(). */
  2874. if (!strncmp(pe->key, "TZ", pe->key_len)) {
  2875. tzset();
  2876. }
  2877. #endif
  2878. efree(pe->putenv_string);
  2879. efree(pe->key);
  2880. }
  2881. /* }}} */
  2882. #endif
  2883. static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
  2884. {
  2885. BG(rand_is_seeded) = 0;
  2886. BG(mt_rand_is_seeded) = 0;
  2887. BG(umask) = -1;
  2888. BG(next) = NULL;
  2889. BG(left) = -1;
  2890. BG(user_tick_functions) = NULL;
  2891. BG(user_filter_map) = NULL;
  2892. BG(serialize_lock) = 0;
  2893. memset(&BG(serialize), 0, sizeof(BG(serialize)));
  2894. memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
  2895. memset(&BG(url_adapt_state_ex), 0, sizeof(BG(url_adapt_state_ex)));
  2896. #if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
  2897. memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
  2898. #endif
  2899. BG(incomplete_class) = incomplete_class_entry;
  2900. BG(page_uid) = -1;
  2901. BG(page_gid) = -1;
  2902. }
  2903. /* }}} */
  2904. static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
  2905. {
  2906. if (BG(url_adapt_state_ex).tags) {
  2907. zend_hash_destroy(BG(url_adapt_state_ex).tags);
  2908. free(BG(url_adapt_state_ex).tags);
  2909. }
  2910. }
  2911. /* }}} */
  2912. #define PHP_DOUBLE_INFINITY_HIGH 0x7ff00000
  2913. #define PHP_DOUBLE_QUIET_NAN_HIGH 0xfff80000
  2914. PHPAPI double php_get_nan(void) /* {{{ */
  2915. {
  2916. #if HAVE_HUGE_VAL_NAN
  2917. return HUGE_VAL + -HUGE_VAL;
  2918. #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
  2919. double val = 0.0;
  2920. ((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
  2921. ((php_uint32*)&val)[0] = 0;
  2922. return val;
  2923. #elif HAVE_ATOF_ACCEPTS_NAN
  2924. return atof("NAN");
  2925. #else
  2926. return 0.0/0.0;
  2927. #endif
  2928. }
  2929. /* }}} */
  2930. PHPAPI double php_get_inf(void) /* {{{ */
  2931. {
  2932. #if HAVE_HUGE_VAL_INF
  2933. return HUGE_VAL;
  2934. #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
  2935. double val = 0.0;
  2936. ((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH;
  2937. ((php_uint32*)&val)[0] = 0;
  2938. return val;
  2939. #elif HAVE_ATOF_ACCEPTS_INF
  2940. return atof("INF");
  2941. #else
  2942. return 1.0/0.0;
  2943. #endif
  2944. }
  2945. /* }}} */
  2946. #define BASIC_MINIT_SUBMODULE(module) \
  2947. if (PHP_MINIT(module)(INIT_FUNC_ARGS_PASSTHRU) == SUCCESS) {\
  2948. BASIC_ADD_SUBMODULE(module); \
  2949. }
  2950. #define BASIC_ADD_SUBMODULE(module) \
  2951. zend_hash_add_empty_element(&basic_submodules, #module, strlen(#module));
  2952. #define BASIC_RINIT_SUBMODULE(module) \
  2953. if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \
  2954. PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU); \
  2955. }
  2956. #define BASIC_MINFO_SUBMODULE(module) \
  2957. if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \
  2958. PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); \
  2959. }
  2960. #define BASIC_RSHUTDOWN_SUBMODULE(module) \
  2961. if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \
  2962. PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \
  2963. }
  2964. #define BASIC_MSHUTDOWN_SUBMODULE(module) \
  2965. if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \
  2966. PHP_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \
  2967. }
  2968. PHP_MINIT_FUNCTION(basic) /* {{{ */
  2969. {
  2970. #ifdef ZTS
  2971. ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
  2972. #ifdef PHP_WIN32
  2973. ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor );
  2974. #endif
  2975. #else
  2976. basic_globals_ctor(&basic_globals TSRMLS_CC);
  2977. #ifdef PHP_WIN32
  2978. php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC);
  2979. #endif
  2980. #endif
  2981. zend_hash_init(&basic_submodules, 0, NULL, NULL, 1);
  2982. BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C);
  2983. REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
  2984. REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);
  2985. REGISTER_LONG_CONSTANT("CONNECTION_TIMEOUT", PHP_CONNECTION_TIMEOUT, CONST_CS | CONST_PERSISTENT);
  2986. REGISTER_LONG_CONSTANT("INI_USER", ZEND_INI_USER, CONST_CS | CONST_PERSISTENT);
  2987. REGISTER_LONG_CONSTANT("INI_PERDIR", ZEND_INI_PERDIR, CONST_CS | CONST_PERSISTENT);
  2988. REGISTER_LONG_CONSTANT("INI_SYSTEM", ZEND_INI_SYSTEM, CONST_CS | CONST_PERSISTENT);
  2989. REGISTER_LONG_CONSTANT("INI_ALL", ZEND_INI_ALL, CONST_CS | CONST_PERSISTENT);
  2990. REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_CS | CONST_PERSISTENT);
  2991. REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_CS | CONST_PERSISTENT);
  2992. REGISTER_LONG_CONSTANT("INI_SCANNER_TYPED", ZEND_INI_SCANNER_TYPED, CONST_CS | CONST_PERSISTENT);
  2993. REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS | CONST_PERSISTENT);
  2994. REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS | CONST_PERSISTENT);
  2995. REGISTER_LONG_CONSTANT("PHP_URL_PORT", PHP_URL_PORT, CONST_CS | CONST_PERSISTENT);
  2996. REGISTER_LONG_CONSTANT("PHP_URL_USER", PHP_URL_USER, CONST_CS | CONST_PERSISTENT);
  2997. REGISTER_LONG_CONSTANT("PHP_URL_PASS", PHP_URL_PASS, CONST_CS | CONST_PERSISTENT);
  2998. REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_CS | CONST_PERSISTENT);
  2999. REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_CS | CONST_PERSISTENT);
  3000. REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_CS | CONST_PERSISTENT);
  3001. REGISTER_LONG_CONSTANT("PHP_QUERY_RFC1738", PHP_QUERY_RFC1738, CONST_CS | CONST_PERSISTENT);
  3002. REGISTER_LONG_CONSTANT("PHP_QUERY_RFC3986", PHP_QUERY_RFC3986, CONST_CS | CONST_PERSISTENT);
  3003. #define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT)
  3004. REGISTER_MATH_CONSTANT(M_E);
  3005. REGISTER_MATH_CONSTANT(M_LOG2E);
  3006. REGISTER_MATH_CONSTANT(M_LOG10E);
  3007. REGISTER_MATH_CONSTANT(M_LN2);
  3008. REGISTER_MATH_CONSTANT(M_LN10);
  3009. REGISTER_MATH_CONSTANT(M_PI);
  3010. REGISTER_MATH_CONSTANT(M_PI_2);
  3011. REGISTER_MATH_CONSTANT(M_PI_4);
  3012. REGISTER_MATH_CONSTANT(M_1_PI);
  3013. REGISTER_MATH_CONSTANT(M_2_PI);
  3014. REGISTER_MATH_CONSTANT(M_SQRTPI);
  3015. REGISTER_MATH_CONSTANT(M_2_SQRTPI);
  3016. REGISTER_MATH_CONSTANT(M_LNPI);
  3017. REGISTER_MATH_CONSTANT(M_EULER);
  3018. REGISTER_MATH_CONSTANT(M_SQRT2);
  3019. REGISTER_MATH_CONSTANT(M_SQRT1_2);
  3020. REGISTER_MATH_CONSTANT(M_SQRT3);
  3021. REGISTER_DOUBLE_CONSTANT("INF", php_get_inf(), CONST_CS | CONST_PERSISTENT);
  3022. REGISTER_DOUBLE_CONSTANT("NAN", php_get_nan(), CONST_CS | CONST_PERSISTENT);
  3023. REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_UP", PHP_ROUND_HALF_UP, CONST_CS | CONST_PERSISTENT);
  3024. REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_DOWN", PHP_ROUND_HALF_DOWN, CONST_CS | CONST_PERSISTENT);
  3025. REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_EVEN", PHP_ROUND_HALF_EVEN, CONST_CS | CONST_PERSISTENT);
  3026. REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_ODD", PHP_ROUND_HALF_ODD, CONST_CS | CONST_PERSISTENT);
  3027. #if ENABLE_TEST_CLASS
  3028. test_class_startup();
  3029. #endif
  3030. register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
  3031. register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
  3032. register_string_constants(INIT_FUNC_ARGS_PASSTHRU);
  3033. BASIC_ADD_SUBMODULE(dl)
  3034. BASIC_ADD_SUBMODULE(mail)
  3035. BASIC_ADD_SUBMODULE(streams)
  3036. BASIC_MINIT_SUBMODULE(file)
  3037. BASIC_MINIT_SUBMODULE(pack)
  3038. BASIC_MINIT_SUBMODULE(browscap)
  3039. BASIC_MINIT_SUBMODULE(standard_filters)
  3040. BASIC_MINIT_SUBMODULE(user_filters)
  3041. BASIC_MINIT_SUBMODULE(password)
  3042. #if defined(HAVE_LOCALECONV) && defined(ZTS)
  3043. BASIC_MINIT_SUBMODULE(localeconv)
  3044. #endif
  3045. #if defined(HAVE_NL_LANGINFO)
  3046. BASIC_MINIT_SUBMODULE(nl_langinfo)
  3047. #endif
  3048. #if HAVE_CRYPT
  3049. BASIC_MINIT_SUBMODULE(crypt)
  3050. #endif
  3051. BASIC_MINIT_SUBMODULE(lcg)
  3052. BASIC_MINIT_SUBMODULE(dir)
  3053. #ifdef HAVE_SYSLOG_H
  3054. BASIC_MINIT_SUBMODULE(syslog)
  3055. #endif
  3056. BASIC_MINIT_SUBMODULE(array)
  3057. BASIC_MINIT_SUBMODULE(assert)
  3058. BASIC_MINIT_SUBMODULE(url_scanner_ex)
  3059. #ifdef PHP_CAN_SUPPORT_PROC_OPEN
  3060. BASIC_MINIT_SUBMODULE(proc_open)
  3061. #endif
  3062. BASIC_MINIT_SUBMODULE(exec)
  3063. BASIC_MINIT_SUBMODULE(user_streams)
  3064. BASIC_MINIT_SUBMODULE(imagetypes)
  3065. php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
  3066. php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
  3067. #ifdef HAVE_GLOB
  3068. php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC);
  3069. #endif
  3070. php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
  3071. php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
  3072. php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
  3073. #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
  3074. # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
  3075. BASIC_MINIT_SUBMODULE(dns)
  3076. # endif
  3077. #endif
  3078. return SUCCESS;
  3079. }
  3080. /* }}} */
  3081. PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
  3082. {
  3083. #ifdef HAVE_SYSLOG_H
  3084. PHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
  3085. #endif
  3086. #ifdef ZTS
  3087. ts_free_id(basic_globals_id);
  3088. #ifdef PHP_WIN32
  3089. ts_free_id(php_win32_core_globals_id);
  3090. #endif
  3091. #else
  3092. basic_globals_dtor(&basic_globals TSRMLS_CC);
  3093. #ifdef PHP_WIN32
  3094. php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC);
  3095. #endif
  3096. #endif
  3097. php_unregister_url_stream_wrapper("php" TSRMLS_CC);
  3098. php_unregister_url_stream_wrapper("http" TSRMLS_CC);
  3099. php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
  3100. BASIC_MSHUTDOWN_SUBMODULE(browscap)
  3101. BASIC_MSHUTDOWN_SUBMODULE(array)
  3102. BASIC_MSHUTDOWN_SUBMODULE(assert)
  3103. BASIC_MSHUTDOWN_SUBMODULE(url_scanner_ex)
  3104. BASIC_MSHUTDOWN_SUBMODULE(file)
  3105. BASIC_MSHUTDOWN_SUBMODULE(standard_filters)
  3106. #if defined(HAVE_LOCALECONV) && defined(ZTS)
  3107. BASIC_MSHUTDOWN_SUBMODULE(localeconv)
  3108. #endif
  3109. #if HAVE_CRYPT
  3110. BASIC_MSHUTDOWN_SUBMODULE(crypt)
  3111. #endif
  3112. zend_hash_destroy(&basic_submodules);
  3113. return SUCCESS;
  3114. }
  3115. /* }}} */
  3116. PHP_RINIT_FUNCTION(basic) /* {{{ */
  3117. {
  3118. memset(BG(strtok_table), 0, 256);
  3119. BG(serialize_lock) = 0;
  3120. memset(&BG(serialize), 0, sizeof(BG(serialize)));
  3121. memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
  3122. BG(strtok_string) = NULL;
  3123. BG(strtok_zval) = NULL;
  3124. BG(strtok_last) = NULL;
  3125. BG(locale_string) = NULL;
  3126. BG(array_walk_fci) = empty_fcall_info;
  3127. BG(array_walk_fci_cache) = empty_fcall_info_cache;
  3128. BG(user_compare_fci) = empty_fcall_info;
  3129. BG(user_compare_fci_cache) = empty_fcall_info_cache;
  3130. BG(page_uid) = -1;
  3131. BG(page_gid) = -1;
  3132. BG(page_inode) = -1;
  3133. BG(page_mtime) = -1;
  3134. #ifdef HAVE_PUTENV
  3135. if (zend_hash_init(&BG(putenv_ht), 1, NULL, (void (*)(void *)) php_putenv_destructor, 0) == FAILURE) {
  3136. return FAILURE;
  3137. }
  3138. #endif
  3139. BG(user_shutdown_function_names) = NULL;
  3140. PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
  3141. #ifdef HAVE_SYSLOG_H
  3142. BASIC_RINIT_SUBMODULE(syslog)
  3143. #endif
  3144. BASIC_RINIT_SUBMODULE(dir)
  3145. BASIC_RINIT_SUBMODULE(url_scanner_ex)
  3146. /* Setup default context */
  3147. FG(default_context) = NULL;
  3148. /* Default to global wrappers only */
  3149. FG(stream_wrappers) = NULL;
  3150. /* Default to global filters only */
  3151. FG(stream_filters) = NULL;
  3152. return SUCCESS;
  3153. }
  3154. /* }}} */
  3155. PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */
  3156. {
  3157. if (BG(strtok_zval)) {
  3158. zval_ptr_dtor(&BG(strtok_zval));
  3159. }
  3160. BG(strtok_string) = NULL;
  3161. BG(strtok_zval) = NULL;
  3162. #ifdef HAVE_PUTENV
  3163. zend_hash_destroy(&BG(putenv_ht));
  3164. #endif
  3165. if (BG(umask) != -1) {
  3166. umask(BG(umask));
  3167. }
  3168. /* Check if locale was changed and change it back
  3169. * to the value in startup environment */
  3170. if (BG(locale_string) != NULL) {
  3171. setlocale(LC_ALL, "C");
  3172. setlocale(LC_CTYPE, "");
  3173. zend_update_current_locale();
  3174. }
  3175. STR_FREE(BG(locale_string));
  3176. BG(locale_string) = NULL;
  3177. /* FG(stream_wrappers) and FG(stream_filters) are destroyed
  3178. * during php_request_shutdown() */
  3179. PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
  3180. #ifdef HAVE_SYSLOG_H
  3181. #ifdef PHP_WIN32
  3182. BASIC_RSHUTDOWN_SUBMODULE(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
  3183. #endif
  3184. #endif
  3185. BASIC_RSHUTDOWN_SUBMODULE(assert)
  3186. BASIC_RSHUTDOWN_SUBMODULE(url_scanner_ex)
  3187. BASIC_RSHUTDOWN_SUBMODULE(streams)
  3188. #ifdef PHP_WIN32
  3189. BASIC_RSHUTDOWN_SUBMODULE(win32_core_globals)
  3190. #endif
  3191. if (BG(user_tick_functions)) {
  3192. zend_llist_destroy(BG(user_tick_functions));
  3193. efree(BG(user_tick_functions));
  3194. BG(user_tick_functions) = NULL;
  3195. }
  3196. BASIC_RSHUTDOWN_SUBMODULE(user_filters)
  3197. BASIC_RSHUTDOWN_SUBMODULE(browscap)
  3198. BG(page_uid) = -1;
  3199. BG(page_gid) = -1;
  3200. return SUCCESS;
  3201. }
  3202. /* }}} */
  3203. PHP_MINFO_FUNCTION(basic) /* {{{ */
  3204. {
  3205. php_info_print_table_start();
  3206. BASIC_MINFO_SUBMODULE(dl)
  3207. BASIC_MINFO_SUBMODULE(mail)
  3208. php_info_print_table_end();
  3209. BASIC_MINFO_SUBMODULE(assert)
  3210. }
  3211. /* }}} */
  3212. /* {{{ proto mixed constant(string const_name)
  3213. Given the name of a constant this function will return the constant's associated value */
  3214. PHP_FUNCTION(constant)
  3215. {
  3216. char *const_name;
  3217. int const_name_len;
  3218. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &const_name, &const_name_len) == FAILURE) {
  3219. return;
  3220. }
  3221. if (!zend_get_constant_ex(const_name, const_name_len, return_value, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC)) {
  3222. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", const_name);
  3223. RETURN_NULL();
  3224. }
  3225. }
  3226. /* }}} */
  3227. #ifdef HAVE_INET_NTOP
  3228. /* {{{ proto string inet_ntop(string in_addr)
  3229. Converts a packed inet address to a human readable IP address string */
  3230. PHP_NAMED_FUNCTION(php_inet_ntop)
  3231. {
  3232. char *address;
  3233. int address_len, af = AF_INET;
  3234. char buffer[40];
  3235. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
  3236. RETURN_FALSE;
  3237. }
  3238. #ifdef HAVE_IPV6
  3239. if (address_len == 16) {
  3240. af = AF_INET6;
  3241. } else
  3242. #endif
  3243. if (address_len != 4) {
  3244. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid in_addr value");
  3245. RETURN_FALSE;
  3246. }
  3247. if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
  3248. php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred");
  3249. RETURN_FALSE;
  3250. }
  3251. RETURN_STRING(buffer, 1);
  3252. }
  3253. /* }}} */
  3254. #endif /* HAVE_INET_NTOP */
  3255. #ifdef HAVE_INET_PTON
  3256. /* {{{ proto string inet_pton(string ip_address)
  3257. Converts a human readable IP address to a packed binary string */
  3258. PHP_NAMED_FUNCTION(php_inet_pton)
  3259. {
  3260. int ret, af = AF_INET;
  3261. char *address;
  3262. int address_len;
  3263. char buffer[17];
  3264. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
  3265. RETURN_FALSE;
  3266. }
  3267. memset(buffer, 0, sizeof(buffer));
  3268. #ifdef HAVE_IPV6
  3269. if (strchr(address, ':')) {
  3270. af = AF_INET6;
  3271. } else
  3272. #endif
  3273. if (!strchr(address, '.')) {
  3274. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
  3275. RETURN_FALSE;
  3276. }
  3277. ret = inet_pton(af, address, buffer);
  3278. if (ret <= 0) {
  3279. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
  3280. RETURN_FALSE;
  3281. }
  3282. RETURN_STRINGL(buffer, af == AF_INET ? 4 : 16, 1);
  3283. }
  3284. /* }}} */
  3285. #endif /* HAVE_INET_PTON */
  3286. /* {{{ proto int ip2long(string ip_address)
  3287. Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address */
  3288. PHP_FUNCTION(ip2long)
  3289. {
  3290. char *addr;
  3291. int addr_len;
  3292. #ifdef HAVE_INET_PTON
  3293. struct in_addr ip;
  3294. #else
  3295. unsigned long int ip;
  3296. #endif
  3297. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
  3298. return;
  3299. }
  3300. #ifdef HAVE_INET_PTON
  3301. if (addr_len == 0 || inet_pton(AF_INET, addr, &ip) != 1) {
  3302. RETURN_FALSE;
  3303. }
  3304. RETURN_LONG(ntohl(ip.s_addr));
  3305. #else
  3306. if (addr_len == 0 || (ip = inet_addr(addr)) == INADDR_NONE) {
  3307. /* The only special case when we should return -1 ourselves,
  3308. * because inet_addr() considers it wrong. We return 0xFFFFFFFF and
  3309. * not -1 or ~0 because of 32/64bit issues. */
  3310. if (addr_len == sizeof("255.255.255.255") - 1 &&
  3311. !memcmp(addr, "255.255.255.255", sizeof("255.255.255.255") - 1)
  3312. ) {
  3313. RETURN_LONG(0xFFFFFFFF);
  3314. }
  3315. RETURN_FALSE;
  3316. }
  3317. RETURN_LONG(ntohl(ip));
  3318. #endif
  3319. }
  3320. /* }}} */
  3321. /* {{{ proto string long2ip(int proper_address)
  3322. Converts an (IPv4) Internet network address into a string in Internet standard dotted format */
  3323. PHP_FUNCTION(long2ip)
  3324. {
  3325. /* "It's a long but it's not, PHP ints are signed */
  3326. char *ip;
  3327. int ip_len;
  3328. unsigned long n;
  3329. struct in_addr myaddr;
  3330. #ifdef HAVE_INET_PTON
  3331. char str[40];
  3332. #endif
  3333. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ip, &ip_len) == FAILURE) {
  3334. return;
  3335. }
  3336. n = strtoul(ip, NULL, 0);
  3337. myaddr.s_addr = htonl(n);
  3338. #ifdef HAVE_INET_PTON
  3339. if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
  3340. RETURN_STRING(str, 1);
  3341. } else {
  3342. RETURN_FALSE;
  3343. }
  3344. #else
  3345. RETURN_STRING(inet_ntoa(myaddr), 1);
  3346. #endif
  3347. }
  3348. /* }}} */
  3349. /********************
  3350. * System Functions *
  3351. ********************/
  3352. /* {{{ proto string getenv(string varname[, bool local_only])
  3353. Get the value of an environment variable */
  3354. PHP_FUNCTION(getenv)
  3355. {
  3356. char *ptr, *str;
  3357. int str_len;
  3358. zend_bool local_only = 0;
  3359. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &local_only) == FAILURE) {
  3360. RETURN_FALSE;
  3361. }
  3362. if (!local_only) {
  3363. /* SAPI method returns an emalloc()'d string */
  3364. ptr = sapi_getenv(str, str_len TSRMLS_CC);
  3365. if (ptr) {
  3366. RETURN_STRING(ptr, 0);
  3367. }
  3368. }
  3369. #ifdef PHP_WIN32
  3370. {
  3371. char dummybuf;
  3372. int size;
  3373. SetLastError(0);
  3374. /*If the given bugger is not large enough to hold the data, the return value is
  3375. the buffer size, in characters, required to hold the string and its terminating
  3376. null character. We use this return value to alloc the final buffer. */
  3377. size = GetEnvironmentVariableA(str, &dummybuf, 0);
  3378. if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
  3379. /* The environment variable doesn't exist. */
  3380. RETURN_FALSE;
  3381. }
  3382. if (size == 0) {
  3383. /* env exists, but it is empty */
  3384. RETURN_EMPTY_STRING();
  3385. }
  3386. ptr = emalloc(size);
  3387. size = GetEnvironmentVariableA(str, ptr, size);
  3388. if (size == 0) {
  3389. /* has been removed between the two calls */
  3390. efree(ptr);
  3391. RETURN_EMPTY_STRING();
  3392. } else {
  3393. RETURN_STRING(ptr, 0);
  3394. }
  3395. }
  3396. #else
  3397. /* system method returns a const */
  3398. ptr = getenv(str);
  3399. if (ptr) {
  3400. RETURN_STRING(ptr, 1);
  3401. }
  3402. #endif
  3403. RETURN_FALSE;
  3404. }
  3405. /* }}} */
  3406. #ifdef HAVE_PUTENV
  3407. /* {{{ proto bool putenv(string setting)
  3408. Set the value of an environment variable */
  3409. PHP_FUNCTION(putenv)
  3410. {
  3411. char *setting;
  3412. int setting_len;
  3413. char *p, **env;
  3414. putenv_entry pe;
  3415. #ifdef PHP_WIN32
  3416. char *value = NULL;
  3417. int equals = 0;
  3418. int error_code;
  3419. #endif
  3420. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &setting, &setting_len) == FAILURE) {
  3421. return;
  3422. }
  3423. if(setting_len == 0 || setting[0] == '=') {
  3424. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter syntax");
  3425. RETURN_FALSE;
  3426. }
  3427. pe.putenv_string = estrndup(setting, setting_len);
  3428. pe.key = estrndup(setting, setting_len);
  3429. if ((p = strchr(pe.key, '='))) { /* nullify the '=' if there is one */
  3430. *p = '\0';
  3431. #ifdef PHP_WIN32
  3432. equals = 1;
  3433. #endif
  3434. }
  3435. pe.key_len = strlen(pe.key);
  3436. #ifdef PHP_WIN32
  3437. if (equals) {
  3438. if (pe.key_len < setting_len - 1) {
  3439. value = p + 1;
  3440. } else {
  3441. /* empty string*/
  3442. value = p;
  3443. }
  3444. }
  3445. #endif
  3446. zend_hash_del(&BG(putenv_ht), pe.key, pe.key_len+1);
  3447. /* find previous value */
  3448. pe.previous_value = NULL;
  3449. for (env = environ; env != NULL && *env != NULL; env++) {
  3450. if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /* found it */
  3451. #if defined(PHP_WIN32)
  3452. /* must copy previous value because MSVCRT's putenv can free the string without notice */
  3453. pe.previous_value = estrdup(*env);
  3454. #else
  3455. pe.previous_value = *env;
  3456. #endif
  3457. break;
  3458. }
  3459. }
  3460. #if HAVE_UNSETENV
  3461. if (!p) { /* no '=' means we want to unset it */
  3462. unsetenv(pe.putenv_string);
  3463. }
  3464. if (!p || putenv(pe.putenv_string) == 0) { /* success */
  3465. #else
  3466. # ifndef PHP_WIN32
  3467. if (putenv(pe.putenv_string) == 0) { /* success */
  3468. # else
  3469. error_code = SetEnvironmentVariable(pe.key, value);
  3470. if (error_code != 0
  3471. # ifndef ZTS
  3472. /* We need both SetEnvironmentVariable and _putenv here as some
  3473. dependency lib could use either way to read the environment.
  3474. Obviously the CRT version will be useful more often. But
  3475. generally, doing both brings us on the safe track at least
  3476. in NTS build. */
  3477. && _putenv_s(pe.key, value ? value : "") == 0
  3478. # endif
  3479. ) { /* success */
  3480. # endif
  3481. #endif
  3482. zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, (void **) &pe, sizeof(putenv_entry), NULL);
  3483. #ifdef HAVE_TZSET
  3484. if (!strncmp(pe.key, "TZ", pe.key_len)) {
  3485. tzset();
  3486. }
  3487. #endif
  3488. RETURN_TRUE;
  3489. } else {
  3490. efree(pe.putenv_string);
  3491. efree(pe.key);
  3492. RETURN_FALSE;
  3493. }
  3494. }
  3495. /* }}} */
  3496. #endif
  3497. /* {{{ free_argv()
  3498. Free the memory allocated to an argv array. */
  3499. static void free_argv(char **argv, int argc)
  3500. {
  3501. int i;
  3502. if (argv) {
  3503. for (i = 0; i < argc; i++) {
  3504. if (argv[i]) {
  3505. efree(argv[i]);
  3506. }
  3507. }
  3508. efree(argv);
  3509. }
  3510. }
  3511. /* }}} */
  3512. /* {{{ free_longopts()
  3513. Free the memory allocated to an longopt array. */
  3514. static void free_longopts(opt_struct *longopts)
  3515. {
  3516. opt_struct *p;
  3517. if (longopts) {
  3518. for (p = longopts; p && p->opt_char != '-'; p++) {
  3519. if (p->opt_name != NULL) {
  3520. efree((char *)(p->opt_name));
  3521. }
  3522. }
  3523. }
  3524. }
  3525. /* }}} */
  3526. /* {{{ parse_opts()
  3527. Convert the typical getopt input characters to the php_getopt struct array */
  3528. static int parse_opts(char * opts, opt_struct ** result)
  3529. {
  3530. opt_struct * paras = NULL;
  3531. unsigned int i, count = 0;
  3532. for (i = 0; i < strlen(opts); i++) {
  3533. if ((opts[i] >= 48 && opts[i] <= 57) ||
  3534. (opts[i] >= 65 && opts[i] <= 90) ||
  3535. (opts[i] >= 97 && opts[i] <= 122)
  3536. ) {
  3537. count++;
  3538. }
  3539. }
  3540. paras = safe_emalloc(sizeof(opt_struct), count, 0);
  3541. memset(paras, 0, sizeof(opt_struct) * count);
  3542. *result = paras;
  3543. while ( (*opts >= 48 && *opts <= 57) || /* 0 - 9 */
  3544. (*opts >= 65 && *opts <= 90) || /* A - Z */
  3545. (*opts >= 97 && *opts <= 122) /* a - z */
  3546. ) {
  3547. paras->opt_char = *opts;
  3548. paras->need_param = (*(++opts) == ':') ? 1 : 0;
  3549. paras->opt_name = NULL;
  3550. if (paras->need_param == 1) {
  3551. opts++;
  3552. if (*opts == ':') {
  3553. paras->need_param++;
  3554. opts++;
  3555. }
  3556. }
  3557. paras++;
  3558. }
  3559. return count;
  3560. }
  3561. /* }}} */
  3562. /* {{{ proto array getopt(string options [, array longopts])
  3563. Get options from the command line argument list */
  3564. PHP_FUNCTION(getopt)
  3565. {
  3566. char *options = NULL, **argv = NULL;
  3567. char opt[2] = { '\0' };
  3568. char *optname;
  3569. int argc = 0, options_len = 0, len, o;
  3570. char *php_optarg = NULL;
  3571. int php_optind = 1;
  3572. zval *val, **args = NULL, *p_longopts = NULL;
  3573. int optname_len = 0;
  3574. opt_struct *opts, *orig_opts;
  3575. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &options, &options_len, &p_longopts) == FAILURE) {
  3576. RETURN_FALSE;
  3577. }
  3578. /* Get argv from the global symbol table. We calculate argc ourselves
  3579. * in order to be on the safe side, even though it is also available
  3580. * from the symbol table. */
  3581. if ((PG(http_globals)[TRACK_VARS_SERVER] || zend_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC)) &&
  3582. (zend_hash_find(Z_ARRVAL_P((PG(http_globals))[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE ||
  3583. zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) && Z_TYPE_PP(args) == IS_ARRAY
  3584. ) {
  3585. int pos = 0;
  3586. zval **entry;
  3587. argc = zend_hash_num_elements(Z_ARRVAL_PP(args));
  3588. /* Attempt to allocate enough memory to hold all of the arguments
  3589. * and a trailing NULL */
  3590. argv = (char **) safe_emalloc(sizeof(char *), (argc + 1), 0);
  3591. /* Reset the array indexes. */
  3592. zend_hash_internal_pointer_reset(Z_ARRVAL_PP(args));
  3593. /* Iterate over the hash to construct the argv array. */
  3594. while (zend_hash_get_current_data(Z_ARRVAL_PP(args), (void **)&entry) == SUCCESS) {
  3595. zval arg, *arg_ptr = *entry;
  3596. if (Z_TYPE_PP(entry) != IS_STRING) {
  3597. arg = **entry;
  3598. zval_copy_ctor(&arg);
  3599. convert_to_string(&arg);
  3600. arg_ptr = &arg;
  3601. }
  3602. argv[pos++] = estrdup(Z_STRVAL_P(arg_ptr));
  3603. if (arg_ptr != *entry) {
  3604. zval_dtor(&arg);
  3605. }
  3606. zend_hash_move_forward(Z_ARRVAL_PP(args));
  3607. }
  3608. /* The C Standard requires argv[argc] to be NULL - this might
  3609. * keep some getopt implementations happy. */
  3610. argv[argc] = NULL;
  3611. } else {
  3612. /* Return false if we can't find argv. */
  3613. RETURN_FALSE;
  3614. }
  3615. len = parse_opts(options, &opts);
  3616. if (p_longopts) {
  3617. int count;
  3618. zval **entry;
  3619. count = zend_hash_num_elements(Z_ARRVAL_P(p_longopts));
  3620. /* the first <len> slots are filled by the one short ops
  3621. * we now extend our array and jump to the new added structs */
  3622. opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1));
  3623. orig_opts = opts;
  3624. opts += len;
  3625. memset(opts, 0, count * sizeof(opt_struct));
  3626. /* Reset the array indexes. */
  3627. zend_hash_internal_pointer_reset(Z_ARRVAL_P(p_longopts));
  3628. /* Iterate over the hash to construct the argv array. */
  3629. while (zend_hash_get_current_data(Z_ARRVAL_P(p_longopts), (void **)&entry) == SUCCESS) {
  3630. zval arg, *arg_ptr = *entry;
  3631. if (Z_TYPE_PP(entry) != IS_STRING) {
  3632. arg = **entry;
  3633. zval_copy_ctor(&arg);
  3634. convert_to_string(&arg);
  3635. arg_ptr = &arg;
  3636. }
  3637. opts->need_param = 0;
  3638. opts->opt_name = estrdup(Z_STRVAL_P(arg_ptr));
  3639. len = strlen(opts->opt_name);
  3640. if ((len > 0) && (opts->opt_name[len - 1] == ':')) {
  3641. opts->need_param++;
  3642. opts->opt_name[len - 1] = '\0';
  3643. if ((len > 1) && (opts->opt_name[len - 2] == ':')) {
  3644. opts->need_param++;
  3645. opts->opt_name[len - 2] = '\0';
  3646. }
  3647. }
  3648. opts->opt_char = 0;
  3649. opts++;
  3650. if (arg_ptr != *entry) {
  3651. zval_dtor(&arg);
  3652. }
  3653. zend_hash_move_forward(Z_ARRVAL_P(p_longopts));
  3654. }
  3655. } else {
  3656. opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
  3657. orig_opts = opts;
  3658. opts += len;
  3659. }
  3660. /* php_getopt want to identify the last param */
  3661. opts->opt_char = '-';
  3662. opts->need_param = 0;
  3663. opts->opt_name = NULL;
  3664. /* Initialize the return value as an array. */
  3665. array_init(return_value);
  3666. /* after our pointer arithmetic jump back to the first element */
  3667. opts = orig_opts;
  3668. while ((o = php_getopt(argc, argv, opts, &php_optarg, &php_optind, 0, 1)) != -1) {
  3669. /* Skip unknown arguments. */
  3670. if (o == '?') {
  3671. continue;
  3672. }
  3673. /* Prepare the option character and the argument string. */
  3674. if (o == 0) {
  3675. optname = opts[php_optidx].opt_name;
  3676. } else {
  3677. if (o == 1) {
  3678. o = '-';
  3679. }
  3680. opt[0] = o;
  3681. optname = opt;
  3682. }
  3683. MAKE_STD_ZVAL(val);
  3684. if (php_optarg != NULL) {
  3685. /* keep the arg as binary, since the encoding is not known */
  3686. ZVAL_STRING(val, php_optarg, 1);
  3687. } else {
  3688. ZVAL_FALSE(val);
  3689. }
  3690. /* Add this option / argument pair to the result hash. */
  3691. optname_len = strlen(optname);
  3692. if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) {
  3693. /* numeric string */
  3694. int optname_int = atoi(optname);
  3695. if (zend_hash_index_find(HASH_OF(return_value), optname_int, (void **)&args) != FAILURE) {
  3696. if (Z_TYPE_PP(args) != IS_ARRAY) {
  3697. convert_to_array_ex(args);
  3698. }
  3699. zend_hash_next_index_insert(HASH_OF(*args), (void *)&val, sizeof(zval *), NULL);
  3700. } else {
  3701. zend_hash_index_update(HASH_OF(return_value), optname_int, &val, sizeof(zval *), NULL);
  3702. }
  3703. } else {
  3704. /* other strings */
  3705. if (zend_hash_find(HASH_OF(return_value), optname, strlen(optname)+1, (void **)&args) != FAILURE) {
  3706. if (Z_TYPE_PP(args) != IS_ARRAY) {
  3707. convert_to_array_ex(args);
  3708. }
  3709. zend_hash_next_index_insert(HASH_OF(*args), (void *)&val, sizeof(zval *), NULL);
  3710. } else {
  3711. zend_hash_add(HASH_OF(return_value), optname, strlen(optname)+1, (void *)&val, sizeof(zval *), NULL);
  3712. }
  3713. }
  3714. php_optarg = NULL;
  3715. }
  3716. free_longopts(orig_opts);
  3717. efree(orig_opts);
  3718. free_argv(argv, argc);
  3719. }
  3720. /* }}} */
  3721. /* {{{ proto void flush(void)
  3722. Flush the output buffer */
  3723. PHP_FUNCTION(flush)
  3724. {
  3725. sapi_flush(TSRMLS_C);
  3726. }
  3727. /* }}} */
  3728. /* {{{ proto void sleep(int seconds)
  3729. Delay for a given number of seconds */
  3730. PHP_FUNCTION(sleep)
  3731. {
  3732. long num;
  3733. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
  3734. RETURN_FALSE;
  3735. }
  3736. if (num < 0) {
  3737. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of seconds must be greater than or equal to 0");
  3738. RETURN_FALSE;
  3739. }
  3740. #ifdef PHP_SLEEP_NON_VOID
  3741. RETURN_LONG(php_sleep(num));
  3742. #else
  3743. php_sleep(num);
  3744. #endif
  3745. }
  3746. /* }}} */
  3747. /* {{{ proto void usleep(int micro_seconds)
  3748. Delay for a given number of micro seconds */
  3749. PHP_FUNCTION(usleep)
  3750. {
  3751. #if HAVE_USLEEP
  3752. long num;
  3753. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
  3754. return;
  3755. }
  3756. if (num < 0) {
  3757. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0");
  3758. RETURN_FALSE;
  3759. }
  3760. usleep(num);
  3761. #endif
  3762. }
  3763. /* }}} */
  3764. #if HAVE_NANOSLEEP
  3765. /* {{{ proto mixed time_nanosleep(long seconds, long nanoseconds)
  3766. Delay for a number of seconds and nano seconds */
  3767. PHP_FUNCTION(time_nanosleep)
  3768. {
  3769. long tv_sec, tv_nsec;
  3770. struct timespec php_req, php_rem;
  3771. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) {
  3772. return;
  3773. }
  3774. if (tv_sec < 0) {
  3775. php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds value must be greater than 0");
  3776. RETURN_FALSE;
  3777. }
  3778. if (tv_nsec < 0) {
  3779. php_error_docref(NULL TSRMLS_CC, E_WARNING, "The nanoseconds value must be greater than 0");
  3780. RETURN_FALSE;
  3781. }
  3782. php_req.tv_sec = (time_t) tv_sec;
  3783. php_req.tv_nsec = tv_nsec;
  3784. if (!nanosleep(&php_req, &php_rem)) {
  3785. RETURN_TRUE;
  3786. } else if (errno == EINTR) {
  3787. array_init(return_value);
  3788. add_assoc_long_ex(return_value, "seconds", sizeof("seconds"), php_rem.tv_sec);
  3789. add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec);
  3790. return;
  3791. } else if (errno == EINVAL) {
  3792. php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
  3793. }
  3794. RETURN_FALSE;
  3795. }
  3796. /* }}} */
  3797. /* {{{ proto mixed time_sleep_until(float timestamp)
  3798. Make the script sleep until the specified time */
  3799. PHP_FUNCTION(time_sleep_until)
  3800. {
  3801. double d_ts, c_ts;
  3802. struct timeval tm;
  3803. struct timespec php_req, php_rem;
  3804. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts) == FAILURE) {
  3805. return;
  3806. }
  3807. if (gettimeofday((struct timeval *) &tm, NULL) != 0) {
  3808. RETURN_FALSE;
  3809. }
  3810. c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00);
  3811. if (c_ts < 0) {
  3812. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sleep until to time is less than current time");
  3813. RETURN_FALSE;
  3814. }
  3815. php_req.tv_sec = (time_t) c_ts;
  3816. if (php_req.tv_sec > c_ts) { /* rounding up occurred */
  3817. php_req.tv_sec--;
  3818. }
  3819. /* 1sec = 1000000000 nanoseconds */
  3820. php_req.tv_nsec = (long) ((c_ts - php_req.tv_sec) * 1000000000.00);
  3821. while (nanosleep(&php_req, &php_rem)) {
  3822. if (errno == EINTR) {
  3823. php_req.tv_sec = php_rem.tv_sec;
  3824. php_req.tv_nsec = php_rem.tv_nsec;
  3825. } else {
  3826. RETURN_FALSE;
  3827. }
  3828. }
  3829. RETURN_TRUE;
  3830. }
  3831. /* }}} */
  3832. #endif
  3833. /* {{{ proto string get_current_user(void)
  3834. Get the name of the owner of the current PHP script */
  3835. PHP_FUNCTION(get_current_user)
  3836. {
  3837. if (zend_parse_parameters_none() == FAILURE) {
  3838. return;
  3839. }
  3840. RETURN_STRING(php_get_current_user(TSRMLS_C), 1);
  3841. }
  3842. /* }}} */
  3843. /* {{{ add_config_entry_cb
  3844. */
  3845. static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
  3846. {
  3847. zval *retval = (zval *)va_arg(args, zval*);
  3848. zval *tmp;
  3849. if (Z_TYPE_P(entry) == IS_STRING) {
  3850. if (hash_key->nKeyLength > 0) {
  3851. add_assoc_stringl_ex(retval, hash_key->arKey, hash_key->nKeyLength, Z_STRVAL_P(entry), Z_STRLEN_P(entry), 1);
  3852. } else {
  3853. add_index_stringl(retval, hash_key->h, Z_STRVAL_P(entry), Z_STRLEN_P(entry), 1);
  3854. }
  3855. } else if (Z_TYPE_P(entry) == IS_ARRAY) {
  3856. MAKE_STD_ZVAL(tmp);
  3857. array_init(tmp);
  3858. zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, tmp);
  3859. add_assoc_zval_ex(retval, hash_key->arKey, hash_key->nKeyLength, tmp);
  3860. }
  3861. return 0;
  3862. }
  3863. /* }}} */
  3864. /* {{{ proto mixed get_cfg_var(string option_name)
  3865. Get the value of a PHP configuration option */
  3866. PHP_FUNCTION(get_cfg_var)
  3867. {
  3868. char *varname;
  3869. int varname_len;
  3870. zval *retval;
  3871. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
  3872. return;
  3873. }
  3874. retval = cfg_get_entry(varname, varname_len + 1);
  3875. if (retval) {
  3876. if (Z_TYPE_P(retval) == IS_ARRAY) {
  3877. array_init(return_value);
  3878. zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
  3879. return;
  3880. } else {
  3881. RETURN_STRING(Z_STRVAL_P(retval), 1);
  3882. }
  3883. } else {
  3884. RETURN_FALSE;
  3885. }
  3886. }
  3887. /* }}} */
  3888. /* {{{ proto bool set_magic_quotes_runtime(int new_setting)
  3889. magic_quotes_runtime is not supported anymore */
  3890. PHP_FUNCTION(set_magic_quotes_runtime)
  3891. {
  3892. zend_bool new_setting;
  3893. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &new_setting) == FAILURE) {
  3894. return;
  3895. }
  3896. if (new_setting) {
  3897. php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore");
  3898. }
  3899. RETURN_FALSE;
  3900. }
  3901. /* }}} */
  3902. /* {{{ proto int get_magic_quotes_runtime(void)
  3903. Get the current active configuration setting of magic_quotes_runtime */
  3904. PHP_FUNCTION(get_magic_quotes_runtime)
  3905. {
  3906. if (zend_parse_parameters_none() == FAILURE) {
  3907. return;
  3908. }
  3909. RETURN_FALSE;
  3910. }
  3911. /* }}} */
  3912. /* {{{ proto int get_magic_quotes_gpc(void)
  3913. Get the current active configuration setting of magic_quotes_gpc */
  3914. PHP_FUNCTION(get_magic_quotes_gpc)
  3915. {
  3916. if (zend_parse_parameters_none() == FAILURE) {
  3917. return;
  3918. }
  3919. RETURN_FALSE;
  3920. }
  3921. /* }}} */
  3922. /*
  3923. 1st arg = error message
  3924. 2nd arg = error option
  3925. 3rd arg = optional parameters (email address or tcp address)
  3926. 4th arg = used for additional headers if email
  3927. error options:
  3928. 0 = send to php_error_log (uses syslog or file depending on ini setting)
  3929. 1 = send via email to 3rd parameter 4th option = additional headers
  3930. 2 = send via tcp/ip to 3rd parameter (name or ip:port)
  3931. 3 = save to file in 3rd parameter
  3932. 4 = send to SAPI logger directly
  3933. */
  3934. /* {{{ proto bool error_log(string message [, int message_type [, string destination [, string extra_headers]]])
  3935. Send an error message somewhere */
  3936. PHP_FUNCTION(error_log)
  3937. {
  3938. char *message, *opt = NULL, *headers = NULL;
  3939. int message_len, opt_len = 0, headers_len = 0;
  3940. int opt_err = 0, argc = ZEND_NUM_ARGS();
  3941. long erropt = 0;
  3942. if (zend_parse_parameters(argc TSRMLS_CC, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
  3943. return;
  3944. }
  3945. if (argc > 1) {
  3946. opt_err = erropt;
  3947. }
  3948. if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) {
  3949. RETURN_FALSE;
  3950. }
  3951. RETURN_TRUE;
  3952. }
  3953. /* }}} */
  3954. /* For BC (not binary-safe!) */
  3955. PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) /* {{{ */
  3956. {
  3957. return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC);
  3958. }
  3959. /* }}} */
  3960. PHPAPI int _php_error_log_ex(int opt_err, char *message, int message_len, char *opt, char *headers TSRMLS_DC) /* {{{ */
  3961. {
  3962. php_stream *stream = NULL;
  3963. switch (opt_err)
  3964. {
  3965. case 1: /*send an email */
  3966. if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
  3967. return FAILURE;
  3968. }
  3969. break;
  3970. case 2: /*send to an address */
  3971. php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!");
  3972. return FAILURE;
  3973. break;
  3974. case 3: /*save to a file */
  3975. stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | REPORT_ERRORS, NULL);
  3976. if (!stream) {
  3977. return FAILURE;
  3978. }
  3979. php_stream_write(stream, message, message_len);
  3980. php_stream_close(stream);
  3981. break;
  3982. case 4: /* send to SAPI */
  3983. if (sapi_module.log_message) {
  3984. sapi_module.log_message(message TSRMLS_CC);
  3985. } else {
  3986. return FAILURE;
  3987. }
  3988. break;
  3989. default:
  3990. php_log_err(message TSRMLS_CC);
  3991. break;
  3992. }
  3993. return SUCCESS;
  3994. }
  3995. /* }}} */
  3996. /* {{{ proto array error_get_last()
  3997. Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
  3998. PHP_FUNCTION(error_get_last)
  3999. {
  4000. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
  4001. return;
  4002. }
  4003. if (PG(last_error_message)) {
  4004. array_init(return_value);
  4005. add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
  4006. add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
  4007. add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
  4008. add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
  4009. }
  4010. }
  4011. /* }}} */
  4012. /* {{{ proto mixed call_user_func(mixed function_name [, mixed parmeter] [, mixed ...])
  4013. Call a user function which is the first parameter */
  4014. PHP_FUNCTION(call_user_func)
  4015. {
  4016. zval *retval_ptr = NULL;
  4017. zend_fcall_info fci;
  4018. zend_fcall_info_cache fci_cache;
  4019. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
  4020. return;
  4021. }
  4022. fci.retval_ptr_ptr = &retval_ptr;
  4023. if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
  4024. COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
  4025. }
  4026. if (fci.params) {
  4027. efree(fci.params);
  4028. }
  4029. }
  4030. /* }}} */
  4031. /* {{{ proto mixed call_user_func_array(string function_name, array parameters)
  4032. Call a user function which is the first parameter with the arguments contained in array */
  4033. PHP_FUNCTION(call_user_func_array)
  4034. {
  4035. zval *params, *retval_ptr = NULL;
  4036. zend_fcall_info fci;
  4037. zend_fcall_info_cache fci_cache;
  4038. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
  4039. return;
  4040. }
  4041. zend_fcall_info_args(&fci, params TSRMLS_CC);
  4042. fci.retval_ptr_ptr = &retval_ptr;
  4043. if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
  4044. COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
  4045. }
  4046. zend_fcall_info_args_clear(&fci, 1);
  4047. }
  4048. /* }}} */
  4049. /* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
  4050. Call a user method on a specific object or class */
  4051. PHP_FUNCTION(call_user_method)
  4052. {
  4053. zval ***params = NULL;
  4054. int n_params = 0;
  4055. zval *retval_ptr;
  4056. zval *callback, *object;
  4057. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z*", &callback, &object, &params, &n_params) == FAILURE) {
  4058. return;
  4059. }
  4060. if (Z_TYPE_P(object) != IS_OBJECT &&
  4061. Z_TYPE_P(object) != IS_STRING
  4062. ) {
  4063. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
  4064. if (params) {
  4065. efree(params);
  4066. }
  4067. RETURN_FALSE;
  4068. }
  4069. convert_to_string(callback);
  4070. if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
  4071. if (retval_ptr) {
  4072. COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
  4073. }
  4074. } else {
  4075. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
  4076. }
  4077. if (n_params) {
  4078. efree(params);
  4079. }
  4080. }
  4081. /* }}} */
  4082. /* {{{ proto mixed call_user_method_array(string method_name, mixed object, array params)
  4083. Call a user method on a specific object or class using a parameter array */
  4084. PHP_FUNCTION(call_user_method_array)
  4085. {
  4086. zval *params, ***method_args = NULL, *retval_ptr;
  4087. zval *callback, *object;
  4088. HashTable *params_ar;
  4089. int num_elems, element = 0;
  4090. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, &params) == FAILURE) {
  4091. return;
  4092. }
  4093. if (Z_TYPE_P(object) != IS_OBJECT &&
  4094. Z_TYPE_P(object) != IS_STRING
  4095. ) {
  4096. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
  4097. RETURN_FALSE;
  4098. }
  4099. convert_to_string(callback);
  4100. params_ar = HASH_OF(params);
  4101. num_elems = zend_hash_num_elements(params_ar);
  4102. method_args = (zval ***) safe_emalloc(sizeof(zval **), num_elems, 0);
  4103. for (zend_hash_internal_pointer_reset(params_ar);
  4104. zend_hash_get_current_data(params_ar, (void **) &(method_args[element])) == SUCCESS;
  4105. zend_hash_move_forward(params_ar)
  4106. ) {
  4107. element++;
  4108. }
  4109. if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) {
  4110. if (retval_ptr) {
  4111. COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
  4112. }
  4113. } else {
  4114. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
  4115. }
  4116. efree(method_args);
  4117. }
  4118. /* }}} */
  4119. /* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U
  4120. Call a user function which is the first parameter */
  4121. PHP_FUNCTION(forward_static_call)
  4122. {
  4123. zval *retval_ptr = NULL;
  4124. zend_fcall_info fci;
  4125. zend_fcall_info_cache fci_cache;
  4126. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
  4127. return;
  4128. }
  4129. if (!EG(active_op_array)->scope) {
  4130. zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active");
  4131. }
  4132. fci.retval_ptr_ptr = &retval_ptr;
  4133. if (EG(called_scope) &&
  4134. instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
  4135. fci_cache.called_scope = EG(called_scope);
  4136. }
  4137. if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
  4138. COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
  4139. }
  4140. if (fci.params) {
  4141. efree(fci.params);
  4142. }
  4143. }
  4144. /* }}} */
  4145. /* {{{ proto mixed call_user_func_array(string function_name, array parameters) U
  4146. Call a user function which is the first parameter with the arguments contained in array */
  4147. PHP_FUNCTION(forward_static_call_array)
  4148. {
  4149. zval *params, *retval_ptr = NULL;
  4150. zend_fcall_info fci;
  4151. zend_fcall_info_cache fci_cache;
  4152. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
  4153. return;
  4154. }
  4155. zend_fcall_info_args(&fci, params TSRMLS_CC);
  4156. fci.retval_ptr_ptr = &retval_ptr;
  4157. if (EG(called_scope) &&
  4158. instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
  4159. fci_cache.called_scope = EG(called_scope);
  4160. }
  4161. if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
  4162. COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
  4163. }
  4164. zend_fcall_info_args_clear(&fci, 1);
  4165. }
  4166. /* }}} */
  4167. void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
  4168. {
  4169. int i;
  4170. for (i = 0; i < shutdown_function_entry->arg_count; i++) {
  4171. zval_ptr_dtor(&shutdown_function_entry->arguments[i]);
  4172. }
  4173. efree(shutdown_function_entry->arguments);
  4174. }
  4175. /* }}} */
  4176. void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* {{{ */
  4177. {
  4178. int i;
  4179. for (i = 0; i < tick_function_entry->arg_count; i++) {
  4180. zval_ptr_dtor(&tick_function_entry->arguments[i]);
  4181. }
  4182. efree(tick_function_entry->arguments);
  4183. }
  4184. /* }}} */
  4185. static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) /* {{{ */
  4186. {
  4187. zval retval;
  4188. char *function_name;
  4189. if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) {
  4190. php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name);
  4191. if (function_name) {
  4192. efree(function_name);
  4193. }
  4194. return 0;
  4195. }
  4196. if (function_name) {
  4197. efree(function_name);
  4198. }
  4199. if (call_user_function(EG(function_table), NULL,
  4200. shutdown_function_entry->arguments[0],
  4201. &retval,
  4202. shutdown_function_entry->arg_count - 1,
  4203. shutdown_function_entry->arguments + 1
  4204. TSRMLS_CC ) == SUCCESS)
  4205. {
  4206. zval_dtor(&retval);
  4207. }
  4208. return 0;
  4209. }
  4210. /* }}} */
  4211. static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) /* {{{ */
  4212. {
  4213. zval retval;
  4214. zval *function = tick_fe->arguments[0];
  4215. /* Prevent reentrant calls to the same user ticks function */
  4216. if (! tick_fe->calling) {
  4217. tick_fe->calling = 1;
  4218. if (call_user_function( EG(function_table), NULL,
  4219. function,
  4220. &retval,
  4221. tick_fe->arg_count - 1,
  4222. tick_fe->arguments + 1
  4223. TSRMLS_CC) == SUCCESS) {
  4224. zval_dtor(&retval);
  4225. } else {
  4226. zval **obj, **method;
  4227. if (Z_TYPE_P(function) == IS_STRING) {
  4228. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
  4229. } else if ( Z_TYPE_P(function) == IS_ARRAY
  4230. && zend_hash_index_find(Z_ARRVAL_P(function), 0, (void **) &obj) == SUCCESS
  4231. && zend_hash_index_find(Z_ARRVAL_P(function), 1, (void **) &method) == SUCCESS
  4232. && Z_TYPE_PP(obj) == IS_OBJECT
  4233. && Z_TYPE_PP(method) == IS_STRING) {
  4234. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method));
  4235. } else {
  4236. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function");
  4237. }
  4238. }
  4239. tick_fe->calling = 0;
  4240. }
  4241. }
  4242. /* }}} */
  4243. static void run_user_tick_functions(int tick_count) /* {{{ */
  4244. {
  4245. TSRMLS_FETCH();
  4246. zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call TSRMLS_CC);
  4247. }
  4248. /* }}} */
  4249. static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_tick_function_entry * tick_fe2) /* {{{ */
  4250. {
  4251. zval *func1 = tick_fe1->arguments[0];
  4252. zval *func2 = tick_fe2->arguments[0];
  4253. int ret;
  4254. TSRMLS_FETCH();
  4255. if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
  4256. ret = (zend_binary_zval_strcmp(func1, func2) == 0);
  4257. } else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
  4258. zval result;
  4259. zend_compare_arrays(&result, func1, func2 TSRMLS_CC);
  4260. ret = (Z_LVAL(result) == 0);
  4261. } else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
  4262. zval result;
  4263. zend_compare_objects(&result, func1, func2 TSRMLS_CC);
  4264. ret = (Z_LVAL(result) == 0);
  4265. } else {
  4266. ret = 0;
  4267. }
  4268. if (ret && tick_fe1->calling) {
  4269. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete tick function executed at the moment");
  4270. return 0;
  4271. }
  4272. return ret;
  4273. }
  4274. /* }}} */
  4275. PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
  4276. {
  4277. if (BG(user_shutdown_function_names)) {
  4278. zend_try {
  4279. zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC);
  4280. }
  4281. zend_end_try();
  4282. php_free_shutdown_functions(TSRMLS_C);
  4283. }
  4284. }
  4285. /* }}} */
  4286. PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
  4287. {
  4288. if (BG(user_shutdown_function_names))
  4289. zend_try {
  4290. zend_hash_destroy(BG(user_shutdown_function_names));
  4291. FREE_HASHTABLE(BG(user_shutdown_function_names));
  4292. BG(user_shutdown_function_names) = NULL;
  4293. } zend_catch {
  4294. /* maybe shutdown method call exit, we just ignore it */
  4295. FREE_HASHTABLE(BG(user_shutdown_function_names));
  4296. BG(user_shutdown_function_names) = NULL;
  4297. } zend_end_try();
  4298. }
  4299. /* }}} */
  4300. /* {{{ proto void register_shutdown_function(callback function) U
  4301. Register a user-level function to be called on request termination */
  4302. PHP_FUNCTION(register_shutdown_function)
  4303. {
  4304. php_shutdown_function_entry shutdown_function_entry;
  4305. char *callback_name = NULL;
  4306. int i;
  4307. shutdown_function_entry.arg_count = ZEND_NUM_ARGS();
  4308. if (shutdown_function_entry.arg_count < 1) {
  4309. WRONG_PARAM_COUNT;
  4310. }
  4311. shutdown_function_entry.arguments = (zval **) safe_emalloc(sizeof(zval *), shutdown_function_entry.arg_count, 0);
  4312. if (zend_get_parameters_array(ht, shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) {
  4313. efree(shutdown_function_entry.arguments);
  4314. RETURN_FALSE;
  4315. }
  4316. /* Prevent entering of anything but valid callback (syntax check only!) */
  4317. if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) {
  4318. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name);
  4319. efree(shutdown_function_entry.arguments);
  4320. RETVAL_FALSE;
  4321. } else {
  4322. if (!BG(user_shutdown_function_names)) {
  4323. ALLOC_HASHTABLE(BG(user_shutdown_function_names));
  4324. zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *)) user_shutdown_function_dtor, 0);
  4325. }
  4326. for (i = 0; i < shutdown_function_entry.arg_count; i++) {
  4327. Z_ADDREF_P(shutdown_function_entry.arguments[i]);
  4328. }
  4329. zend_hash_next_index_insert(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL);
  4330. }
  4331. if (callback_name) {
  4332. efree(callback_name);
  4333. }
  4334. }
  4335. /* }}} */
  4336. PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) /* {{{ */
  4337. {
  4338. if (!BG(user_shutdown_function_names)) {
  4339. ALLOC_HASHTABLE(BG(user_shutdown_function_names));
  4340. zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *)) user_shutdown_function_dtor, 0);
  4341. }
  4342. return zend_hash_update(BG(user_shutdown_function_names), function_name, function_len, shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL) != FAILURE;
  4343. }
  4344. /* }}} */
  4345. PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC) /* {{{ */
  4346. {
  4347. if (BG(user_shutdown_function_names)) {
  4348. return zend_hash_del_key_or_index(BG(user_shutdown_function_names), function_name, function_len, 0, HASH_DEL_KEY) != FAILURE;
  4349. }
  4350. return 0;
  4351. }
  4352. /* }}} */
  4353. PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC) /* {{{ */
  4354. {
  4355. if (!BG(user_shutdown_function_names)) {
  4356. ALLOC_HASHTABLE(BG(user_shutdown_function_names));
  4357. zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *)) user_shutdown_function_dtor, 0);
  4358. }
  4359. return zend_hash_next_index_insert(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL) != FAILURE;
  4360. }
  4361. /* }}} */
  4362. ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini) /* {{{ */
  4363. {
  4364. syntax_highlighter_ini->highlight_comment = INI_STR("highlight.comment");
  4365. syntax_highlighter_ini->highlight_default = INI_STR("highlight.default");
  4366. syntax_highlighter_ini->highlight_html = INI_STR("highlight.html");
  4367. syntax_highlighter_ini->highlight_keyword = INI_STR("highlight.keyword");
  4368. syntax_highlighter_ini->highlight_string = INI_STR("highlight.string");
  4369. }
  4370. /* }}} */
  4371. /* {{{ proto bool highlight_file(string file_name [, bool return] )
  4372. Syntax highlight a source file */
  4373. PHP_FUNCTION(highlight_file)
  4374. {
  4375. char *filename;
  4376. int filename_len, ret;
  4377. zend_syntax_highlighter_ini syntax_highlighter_ini;
  4378. zend_bool i = 0;
  4379. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) {
  4380. RETURN_FALSE;
  4381. }
  4382. if (php_check_open_basedir(filename TSRMLS_CC)) {
  4383. RETURN_FALSE;
  4384. }
  4385. if (i) {
  4386. php_output_start_default(TSRMLS_C);
  4387. }
  4388. php_get_highlight_struct(&syntax_highlighter_ini);
  4389. ret = highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC);
  4390. if (ret == FAILURE) {
  4391. if (i) {
  4392. php_output_end(TSRMLS_C);
  4393. }
  4394. RETURN_FALSE;
  4395. }
  4396. if (i) {
  4397. php_output_get_contents(return_value TSRMLS_CC);
  4398. php_output_discard(TSRMLS_C);
  4399. } else {
  4400. RETURN_TRUE;
  4401. }
  4402. }
  4403. /* }}} */
  4404. /* {{{ proto string php_strip_whitespace(string file_name)
  4405. Return source with stripped comments and whitespace */
  4406. PHP_FUNCTION(php_strip_whitespace)
  4407. {
  4408. char *filename;
  4409. int filename_len;
  4410. zend_lex_state original_lex_state;
  4411. zend_file_handle file_handle = {0};
  4412. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
  4413. RETURN_FALSE;
  4414. }
  4415. php_output_start_default(TSRMLS_C);
  4416. file_handle.type = ZEND_HANDLE_FILENAME;
  4417. file_handle.filename = filename;
  4418. file_handle.free_filename = 0;
  4419. file_handle.opened_path = NULL;
  4420. zend_save_lexical_state(&original_lex_state TSRMLS_CC);
  4421. if (open_file_for_scanning(&file_handle TSRMLS_CC) == FAILURE) {
  4422. zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
  4423. php_output_end(TSRMLS_C);
  4424. RETURN_EMPTY_STRING();
  4425. }
  4426. zend_strip(TSRMLS_C);
  4427. zend_destroy_file_handle(&file_handle TSRMLS_CC);
  4428. zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
  4429. php_output_get_contents(return_value TSRMLS_CC);
  4430. php_output_discard(TSRMLS_C);
  4431. }
  4432. /* }}} */
  4433. /* {{{ proto bool highlight_string(string string [, bool return] )
  4434. Syntax highlight a string or optionally return it */
  4435. PHP_FUNCTION(highlight_string)
  4436. {
  4437. zval **expr;
  4438. zend_syntax_highlighter_ini syntax_highlighter_ini;
  4439. char *hicompiled_string_description;
  4440. zend_bool i = 0;
  4441. int old_error_reporting = EG(error_reporting);
  4442. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) {
  4443. RETURN_FALSE;
  4444. }
  4445. convert_to_string_ex(expr);
  4446. if (i) {
  4447. php_output_start_default(TSRMLS_C);
  4448. }
  4449. EG(error_reporting) = E_ERROR;
  4450. php_get_highlight_struct(&syntax_highlighter_ini);
  4451. hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);
  4452. if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
  4453. efree(hicompiled_string_description);
  4454. EG(error_reporting) = old_error_reporting;
  4455. if (i) {
  4456. php_output_end(TSRMLS_C);
  4457. }
  4458. RETURN_FALSE;
  4459. }
  4460. efree(hicompiled_string_description);
  4461. EG(error_reporting) = old_error_reporting;
  4462. if (i) {
  4463. php_output_get_contents(return_value TSRMLS_CC);
  4464. php_output_discard(TSRMLS_C);
  4465. } else {
  4466. RETURN_TRUE;
  4467. }
  4468. }
  4469. /* }}} */
  4470. /* {{{ proto string ini_get(string varname)
  4471. Get a configuration option */
  4472. PHP_FUNCTION(ini_get)
  4473. {
  4474. char *varname, *str;
  4475. int varname_len;
  4476. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
  4477. return;
  4478. }
  4479. str = zend_ini_string(varname, varname_len + 1, 0);
  4480. if (!str) {
  4481. RETURN_FALSE;
  4482. }
  4483. RETURN_STRING(str, 1);
  4484. }
  4485. /* }}} */
  4486. static int php_ini_get_option(zend_ini_entry *ini_entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
  4487. {
  4488. zval *ini_array = va_arg(args, zval *);
  4489. int module_number = va_arg(args, int);
  4490. int details = va_arg(args, int);
  4491. zval *option;
  4492. if (module_number != 0 && ini_entry->module_number != module_number) {
  4493. return 0;
  4494. }
  4495. if (hash_key->nKeyLength == 0 ||
  4496. hash_key->arKey[0] != 0
  4497. ) {
  4498. if (details) {
  4499. MAKE_STD_ZVAL(option);
  4500. array_init(option);
  4501. if (ini_entry->orig_value) {
  4502. add_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1);
  4503. } else if (ini_entry->value) {
  4504. add_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1);
  4505. } else {
  4506. add_assoc_null(option, "global_value");
  4507. }
  4508. if (ini_entry->value) {
  4509. add_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1);
  4510. } else {
  4511. add_assoc_null(option, "local_value");
  4512. }
  4513. add_assoc_long(option, "access", ini_entry->modifiable);
  4514. add_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, option);
  4515. } else {
  4516. if (ini_entry->value) {
  4517. add_assoc_stringl(ini_array, ini_entry->name, ini_entry->value, ini_entry->value_length, 1);
  4518. } else {
  4519. add_assoc_null(ini_array, ini_entry->name);
  4520. }
  4521. }
  4522. }
  4523. return 0;
  4524. }
  4525. /* }}} */
  4526. /* {{{ proto array ini_get_all([string extension[, bool details = true]])
  4527. Get all configuration options */
  4528. PHP_FUNCTION(ini_get_all)
  4529. {
  4530. char *extname = NULL;
  4531. int extname_len = 0, extnumber = 0;
  4532. zend_module_entry *module;
  4533. zend_bool details = 1;
  4534. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &extname, &extname_len, &details) == FAILURE) {
  4535. return;
  4536. }
  4537. zend_ini_sort_entries(TSRMLS_C);
  4538. if (extname) {
  4539. if (zend_hash_find(&module_registry, extname, extname_len+1, (void **) &module) == FAILURE) {
  4540. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname);
  4541. RETURN_FALSE;
  4542. }
  4543. extnumber = module->module_number;
  4544. }
  4545. array_init(return_value);
  4546. zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) php_ini_get_option, 2, return_value, extnumber, details);
  4547. }
  4548. /* }}} */
  4549. static int php_ini_check_path(char *option_name, int option_len, char *new_option_name, int new_option_len) /* {{{ */
  4550. {
  4551. if (option_len != (new_option_len - 1)) {
  4552. return 0;
  4553. }
  4554. return !strncmp(option_name, new_option_name, option_len);
  4555. }
  4556. /* }}} */
  4557. /* {{{ proto string ini_set(string varname, string newvalue)
  4558. Set a configuration option, returns false on error and the old value of the configuration option on success */
  4559. PHP_FUNCTION(ini_set)
  4560. {
  4561. char *varname, *new_value;
  4562. int varname_len, new_value_len;
  4563. char *old_value;
  4564. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &varname, &varname_len, &new_value, &new_value_len) == FAILURE) {
  4565. return;
  4566. }
  4567. old_value = zend_ini_string(varname, varname_len + 1, 0);
  4568. /* copy to return here, because alter might free it! */
  4569. if (old_value) {
  4570. RETVAL_STRING(old_value, 1);
  4571. } else {
  4572. RETVAL_FALSE;
  4573. }
  4574. #define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini))
  4575. /* open basedir check */
  4576. if (PG(open_basedir)) {
  4577. if (_CHECK_PATH(varname, varname_len, "error_log") ||
  4578. _CHECK_PATH(varname, varname_len, "java.class.path") ||
  4579. _CHECK_PATH(varname, varname_len, "java.home") ||
  4580. _CHECK_PATH(varname, varname_len, "mail.log") ||
  4581. _CHECK_PATH(varname, varname_len, "java.library.path") ||
  4582. _CHECK_PATH(varname, varname_len, "vpopmail.directory")) {
  4583. if (php_check_open_basedir(new_value TSRMLS_CC)) {
  4584. zval_dtor(return_value);
  4585. RETURN_FALSE;
  4586. }
  4587. }
  4588. }
  4589. if (zend_alter_ini_entry_ex(varname, varname_len + 1, new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
  4590. zval_dtor(return_value);
  4591. RETURN_FALSE;
  4592. }
  4593. }
  4594. /* }}} */
  4595. /* {{{ proto void ini_restore(string varname)
  4596. Restore the value of a configuration option specified by varname */
  4597. PHP_FUNCTION(ini_restore)
  4598. {
  4599. char *varname;
  4600. int varname_len;
  4601. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
  4602. return;
  4603. }
  4604. zend_restore_ini_entry(varname, varname_len+1, PHP_INI_STAGE_RUNTIME);
  4605. }
  4606. /* }}} */
  4607. /* {{{ proto string set_include_path(string new_include_path)
  4608. Sets the include_path configuration option */
  4609. PHP_FUNCTION(set_include_path)
  4610. {
  4611. char *new_value;
  4612. int new_value_len;
  4613. char *old_value;
  4614. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &new_value, &new_value_len) == FAILURE) {
  4615. return;
  4616. }
  4617. old_value = zend_ini_string("include_path", sizeof("include_path"), 0);
  4618. /* copy to return here, because alter might free it! */
  4619. if (old_value) {
  4620. RETVAL_STRING(old_value, 1);
  4621. } else {
  4622. RETVAL_FALSE;
  4623. }
  4624. if (zend_alter_ini_entry_ex("include_path", sizeof("include_path"), new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
  4625. zval_dtor(return_value);
  4626. RETURN_FALSE;
  4627. }
  4628. }
  4629. /* }}} */
  4630. /* {{{ proto string get_include_path()
  4631. Get the current include_path configuration option */
  4632. PHP_FUNCTION(get_include_path)
  4633. {
  4634. char *str;
  4635. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
  4636. return;
  4637. }
  4638. str = zend_ini_string("include_path", sizeof("include_path"), 0);
  4639. if (str == NULL) {
  4640. RETURN_FALSE;
  4641. }
  4642. RETURN_STRING(str, 1);
  4643. }
  4644. /* }}} */
  4645. /* {{{ proto void restore_include_path()
  4646. Restore the value of the include_path configuration option */
  4647. PHP_FUNCTION(restore_include_path)
  4648. {
  4649. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
  4650. return;
  4651. }
  4652. zend_restore_ini_entry("include_path", sizeof("include_path"), PHP_INI_STAGE_RUNTIME);
  4653. }
  4654. /* }}} */
  4655. /* {{{ proto mixed print_r(mixed var [, bool return])
  4656. Prints out or returns information about the specified variable */
  4657. PHP_FUNCTION(print_r)
  4658. {
  4659. zval *var;
  4660. zend_bool do_return = 0;
  4661. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &do_return) == FAILURE) {
  4662. RETURN_FALSE;
  4663. }
  4664. if (do_return) {
  4665. php_output_start_default(TSRMLS_C);
  4666. }
  4667. zend_print_zval_r(var, 0 TSRMLS_CC);
  4668. if (do_return) {
  4669. php_output_get_contents(return_value TSRMLS_CC);
  4670. php_output_discard(TSRMLS_C);
  4671. } else {
  4672. RETURN_TRUE;
  4673. }
  4674. }
  4675. /* }}} */
  4676. /* {{{ proto int connection_aborted(void)
  4677. Returns true if client disconnected */
  4678. PHP_FUNCTION(connection_aborted)
  4679. {
  4680. RETURN_LONG(PG(connection_status) & PHP_CONNECTION_ABORTED);
  4681. }
  4682. /* }}} */
  4683. /* {{{ proto int connection_status(void)
  4684. Returns the connection status bitfield */
  4685. PHP_FUNCTION(connection_status)
  4686. {
  4687. RETURN_LONG(PG(connection_status));
  4688. }
  4689. /* }}} */
  4690. /* {{{ proto int ignore_user_abort([string value])
  4691. Set whether we want to ignore a user abort event or not */
  4692. PHP_FUNCTION(ignore_user_abort)
  4693. {
  4694. char *arg = NULL;
  4695. int arg_len = 0;
  4696. int old_setting;
  4697. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
  4698. return;
  4699. }
  4700. old_setting = PG(ignore_user_abort);
  4701. if (arg) {
  4702. zend_alter_ini_entry_ex("ignore_user_abort", sizeof("ignore_user_abort"), arg, arg_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
  4703. }
  4704. RETURN_LONG(old_setting);
  4705. }
  4706. /* }}} */
  4707. #if HAVE_GETSERVBYNAME
  4708. /* {{{ proto int getservbyname(string service, string protocol)
  4709. Returns port associated with service. Protocol must be "tcp" or "udp" */
  4710. PHP_FUNCTION(getservbyname)
  4711. {
  4712. char *name, *proto;
  4713. int name_len, proto_len;
  4714. struct servent *serv;
  4715. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
  4716. return;
  4717. }
  4718. /* empty string behaves like NULL on windows implementation of
  4719. getservbyname. Let be portable instead. */
  4720. #ifdef PHP_WIN32
  4721. if (proto_len == 0) {
  4722. RETURN_FALSE;
  4723. }
  4724. #endif
  4725. serv = getservbyname(name, proto);
  4726. if (serv == NULL) {
  4727. RETURN_FALSE;
  4728. }
  4729. RETURN_LONG(ntohs(serv->s_port));
  4730. }
  4731. /* }}} */
  4732. #endif
  4733. #if HAVE_GETSERVBYPORT
  4734. /* {{{ proto string getservbyport(int port, string protocol)
  4735. Returns service name associated with port. Protocol must be "tcp" or "udp" */
  4736. PHP_FUNCTION(getservbyport)
  4737. {
  4738. char *proto;
  4739. int proto_len;
  4740. long port;
  4741. struct servent *serv;
  4742. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &port, &proto, &proto_len) == FAILURE) {
  4743. return;
  4744. }
  4745. serv = getservbyport(htons((unsigned short) port), proto);
  4746. if (serv == NULL) {
  4747. RETURN_FALSE;
  4748. }
  4749. RETURN_STRING(serv->s_name, 1);
  4750. }
  4751. /* }}} */
  4752. #endif
  4753. #if HAVE_GETPROTOBYNAME
  4754. /* {{{ proto int getprotobyname(string name)
  4755. Returns protocol number associated with name as per /etc/protocols */
  4756. PHP_FUNCTION(getprotobyname)
  4757. {
  4758. char *name;
  4759. int name_len;
  4760. struct protoent *ent;
  4761. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
  4762. return;
  4763. }
  4764. ent = getprotobyname(name);
  4765. if (ent == NULL) {
  4766. RETURN_FALSE;
  4767. }
  4768. RETURN_LONG(ent->p_proto);
  4769. }
  4770. /* }}} */
  4771. #endif
  4772. #if HAVE_GETPROTOBYNUMBER
  4773. /* {{{ proto string getprotobynumber(int proto)
  4774. Returns protocol name associated with protocol number proto */
  4775. PHP_FUNCTION(getprotobynumber)
  4776. {
  4777. long proto;
  4778. struct protoent *ent;
  4779. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &proto) == FAILURE) {
  4780. return;
  4781. }
  4782. ent = getprotobynumber(proto);
  4783. if (ent == NULL) {
  4784. RETURN_FALSE;
  4785. }
  4786. RETURN_STRING(ent->p_name, 1);
  4787. }
  4788. /* }}} */
  4789. #endif
  4790. /* {{{ proto bool register_tick_function(string function_name [, mixed arg [, mixed ... ]])
  4791. Registers a tick callback function */
  4792. PHP_FUNCTION(register_tick_function)
  4793. {
  4794. user_tick_function_entry tick_fe;
  4795. int i;
  4796. char *function_name = NULL;
  4797. tick_fe.calling = 0;
  4798. tick_fe.arg_count = ZEND_NUM_ARGS();
  4799. if (tick_fe.arg_count < 1) {
  4800. WRONG_PARAM_COUNT;
  4801. }
  4802. tick_fe.arguments = (zval **) safe_emalloc(sizeof(zval *), tick_fe.arg_count, 0);
  4803. if (zend_get_parameters_array(ht, tick_fe.arg_count, tick_fe.arguments) == FAILURE) {
  4804. efree(tick_fe.arguments);
  4805. RETURN_FALSE;
  4806. }
  4807. if (!zend_is_callable(tick_fe.arguments[0], 0, &function_name TSRMLS_CC)) {
  4808. efree(tick_fe.arguments);
  4809. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid tick callback '%s' passed", function_name);
  4810. efree(function_name);
  4811. RETURN_FALSE;
  4812. } else if (function_name) {
  4813. efree(function_name);
  4814. }
  4815. if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE_P(tick_fe.arguments[0]) != IS_OBJECT) {
  4816. convert_to_string_ex(&tick_fe.arguments[0]);
  4817. }
  4818. if (!BG(user_tick_functions)) {
  4819. BG(user_tick_functions) = (zend_llist *) emalloc(sizeof(zend_llist));
  4820. zend_llist_init(BG(user_tick_functions),
  4821. sizeof(user_tick_function_entry),
  4822. (llist_dtor_func_t) user_tick_function_dtor, 0);
  4823. php_add_tick_function(run_user_tick_functions);
  4824. }
  4825. for (i = 0; i < tick_fe.arg_count; i++) {
  4826. Z_ADDREF_P(tick_fe.arguments[i]);
  4827. }
  4828. zend_llist_add_element(BG(user_tick_functions), &tick_fe);
  4829. RETURN_TRUE;
  4830. }
  4831. /* }}} */
  4832. /* {{{ proto void unregister_tick_function(string function_name)
  4833. Unregisters a tick callback function */
  4834. PHP_FUNCTION(unregister_tick_function)
  4835. {
  4836. zval *function;
  4837. user_tick_function_entry tick_fe;
  4838. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) {
  4839. return;
  4840. }
  4841. if (!BG(user_tick_functions)) {
  4842. return;
  4843. }
  4844. if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) {
  4845. convert_to_string(function);
  4846. }
  4847. tick_fe.arguments = (zval **) emalloc(sizeof(zval *));
  4848. tick_fe.arguments[0] = function;
  4849. tick_fe.arg_count = 1;
  4850. zend_llist_del_element(BG(user_tick_functions), &tick_fe, (int (*)(void *, void *)) user_tick_function_compare);
  4851. efree(tick_fe.arguments);
  4852. }
  4853. /* }}} */
  4854. /* {{{ proto bool is_uploaded_file(string path)
  4855. Check if file was created by rfc1867 upload */
  4856. PHP_FUNCTION(is_uploaded_file)
  4857. {
  4858. char *path;
  4859. int path_len;
  4860. if (!SG(rfc1867_uploaded_files)) {
  4861. RETURN_FALSE;
  4862. }
  4863. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
  4864. return;
  4865. }
  4866. if (zend_hash_exists(SG(rfc1867_uploaded_files), path, path_len + 1)) {
  4867. RETURN_TRUE;
  4868. } else {
  4869. RETURN_FALSE;
  4870. }
  4871. }
  4872. /* }}} */
  4873. /* {{{ proto bool move_uploaded_file(string path, string new_path)
  4874. Move a file if and only if it was created by an upload */
  4875. PHP_FUNCTION(move_uploaded_file)
  4876. {
  4877. char *path, *new_path;
  4878. int path_len, new_path_len;
  4879. zend_bool successful = 0;
  4880. #ifndef PHP_WIN32
  4881. int oldmask; int ret;
  4882. #endif
  4883. if (!SG(rfc1867_uploaded_files)) {
  4884. RETURN_FALSE;
  4885. }
  4886. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
  4887. return;
  4888. }
  4889. if (!zend_hash_exists(SG(rfc1867_uploaded_files), path, path_len + 1)) {
  4890. RETURN_FALSE;
  4891. }
  4892. if (php_check_open_basedir(new_path TSRMLS_CC)) {
  4893. RETURN_FALSE;
  4894. }
  4895. if (VCWD_RENAME(path, new_path) == 0) {
  4896. successful = 1;
  4897. #ifndef PHP_WIN32
  4898. oldmask = umask(077);
  4899. umask(oldmask);
  4900. ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);
  4901. if (ret == -1) {
  4902. php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
  4903. }
  4904. #endif
  4905. } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
  4906. VCWD_UNLINK(path);
  4907. successful = 1;
  4908. }
  4909. if (successful) {
  4910. zend_hash_del(SG(rfc1867_uploaded_files), path, path_len + 1);
  4911. } else {
  4912. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
  4913. }
  4914. RETURN_BOOL(successful);
  4915. }
  4916. /* }}} */
  4917. /* {{{ php_simple_ini_parser_cb
  4918. */
  4919. static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
  4920. {
  4921. zval *element;
  4922. switch (callback_type) {
  4923. case ZEND_INI_PARSER_ENTRY:
  4924. if (!arg2) {
  4925. /* bare string - nothing to do */
  4926. break;
  4927. }
  4928. ALLOC_ZVAL(element);
  4929. MAKE_COPY_ZVAL(&arg2, element);
  4930. zend_symtable_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &element, sizeof(zval *), NULL);
  4931. break;
  4932. case ZEND_INI_PARSER_POP_ENTRY:
  4933. {
  4934. zval *hash, **find_hash;
  4935. if (!arg2) {
  4936. /* bare string - nothing to do */
  4937. break;
  4938. }
  4939. if (!(Z_STRLEN_P(arg1) > 1 && Z_STRVAL_P(arg1)[0] == '0') && is_numeric_string(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), NULL, NULL, 0) == IS_LONG) {
  4940. ulong key = (ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
  4941. if (zend_hash_index_find(Z_ARRVAL_P(arr), key, (void **) &find_hash) == FAILURE) {
  4942. ALLOC_ZVAL(hash);
  4943. INIT_PZVAL(hash);
  4944. array_init(hash);
  4945. zend_hash_index_update(Z_ARRVAL_P(arr), key, &hash, sizeof(zval *), NULL);
  4946. } else {
  4947. hash = *find_hash;
  4948. }
  4949. } else {
  4950. if (zend_hash_find(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, (void **) &find_hash) == FAILURE) {
  4951. ALLOC_ZVAL(hash);
  4952. INIT_PZVAL(hash);
  4953. array_init(hash);
  4954. zend_hash_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &hash, sizeof(zval *), NULL);
  4955. } else {
  4956. hash = *find_hash;
  4957. }
  4958. }
  4959. if (Z_TYPE_P(hash) != IS_ARRAY) {
  4960. zval_dtor(hash);
  4961. INIT_PZVAL(hash);
  4962. array_init(hash);
  4963. }
  4964. ALLOC_ZVAL(element);
  4965. MAKE_COPY_ZVAL(&arg2, element);
  4966. if (!arg3 || (Z_TYPE_P(arg3) == IS_STRING && Z_STRLEN_P(arg3) == 0)) {
  4967. add_next_index_zval(hash, element);
  4968. } else {
  4969. array_set_zval_key(Z_ARRVAL_P(hash), arg3, element);
  4970. zval_ptr_dtor(&element);
  4971. }
  4972. }
  4973. break;
  4974. case ZEND_INI_PARSER_SECTION:
  4975. break;
  4976. }
  4977. }
  4978. /* }}} */
  4979. /* {{{ php_ini_parser_cb_with_sections
  4980. */
  4981. static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
  4982. {
  4983. if (callback_type == ZEND_INI_PARSER_SECTION) {
  4984. MAKE_STD_ZVAL(BG(active_ini_file_section));
  4985. array_init(BG(active_ini_file_section));
  4986. zend_symtable_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &BG(active_ini_file_section), sizeof(zval *), NULL);
  4987. } else if (arg2) {
  4988. zval *active_arr;
  4989. if (BG(active_ini_file_section)) {
  4990. active_arr = BG(active_ini_file_section);
  4991. } else {
  4992. active_arr = arr;
  4993. }
  4994. php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr TSRMLS_CC);
  4995. }
  4996. }
  4997. /* }}} */
  4998. /* {{{ proto array parse_ini_file(string filename [, bool process_sections [, int scanner_mode]])
  4999. Parse configuration file */
  5000. PHP_FUNCTION(parse_ini_file)
  5001. {
  5002. char *filename = NULL;
  5003. int filename_len = 0;
  5004. zend_bool process_sections = 0;
  5005. long scanner_mode = ZEND_INI_SCANNER_NORMAL;
  5006. zend_file_handle fh;
  5007. zend_ini_parser_cb_t ini_parser_cb;
  5008. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
  5009. RETURN_FALSE;
  5010. }
  5011. if (filename_len == 0) {
  5012. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty!");
  5013. RETURN_FALSE;
  5014. }
  5015. /* Set callback function */
  5016. if (process_sections) {
  5017. BG(active_ini_file_section) = NULL;
  5018. ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
  5019. } else {
  5020. ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
  5021. }
  5022. /* Setup filehandle */
  5023. memset(&fh, 0, sizeof(fh));
  5024. fh.filename = filename;
  5025. fh.type = ZEND_HANDLE_FILENAME;
  5026. array_init(return_value);
  5027. if (zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
  5028. zend_hash_destroy(Z_ARRVAL_P(return_value));
  5029. efree(Z_ARRVAL_P(return_value));
  5030. RETURN_FALSE;
  5031. }
  5032. }
  5033. /* }}} */
  5034. /* {{{ proto array parse_ini_string(string ini_string [, bool process_sections [, int scanner_mode]])
  5035. Parse configuration string */
  5036. PHP_FUNCTION(parse_ini_string)
  5037. {
  5038. char *string = NULL, *str = NULL;
  5039. int str_len = 0;
  5040. zend_bool process_sections = 0;
  5041. long scanner_mode = ZEND_INI_SCANNER_NORMAL;
  5042. zend_ini_parser_cb_t ini_parser_cb;
  5043. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
  5044. RETURN_FALSE;
  5045. }
  5046. if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
  5047. RETVAL_FALSE;
  5048. }
  5049. /* Set callback function */
  5050. if (process_sections) {
  5051. BG(active_ini_file_section) = NULL;
  5052. ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
  5053. } else {
  5054. ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
  5055. }
  5056. /* Setup string */
  5057. string = (char *) emalloc(str_len + ZEND_MMAP_AHEAD);
  5058. memcpy(string, str, str_len);
  5059. memset(string + str_len, 0, ZEND_MMAP_AHEAD);
  5060. array_init(return_value);
  5061. if (zend_parse_ini_string(string, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
  5062. zend_hash_destroy(Z_ARRVAL_P(return_value));
  5063. efree(Z_ARRVAL_P(return_value));
  5064. RETVAL_FALSE;
  5065. }
  5066. efree(string);
  5067. }
  5068. /* }}} */
  5069. #if ZEND_DEBUG
  5070. /* This function returns an array of ALL valid ini options with values and
  5071. * is not the same as ini_get_all() which returns only registered ini options. Only useful for devs to debug php.ini scanner/parser! */
  5072. PHP_FUNCTION(config_get_hash) /* {{{ */
  5073. {
  5074. HashTable *hash = php_ini_get_configuration_hash();
  5075. array_init(return_value);
  5076. zend_hash_apply_with_arguments(hash TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
  5077. }
  5078. /* }}} */
  5079. #endif
  5080. #ifdef HAVE_GETLOADAVG
  5081. /* {{{ proto array sys_getloadavg()
  5082. */
  5083. PHP_FUNCTION(sys_getloadavg)
  5084. {
  5085. double load[3];
  5086. if (zend_parse_parameters_none() == FAILURE) {
  5087. return;
  5088. }
  5089. if (getloadavg(load, 3) == -1) {
  5090. RETURN_FALSE;
  5091. } else {
  5092. array_init(return_value);
  5093. add_index_double(return_value, 0, load[0]);
  5094. add_index_double(return_value, 1, load[1]);
  5095. add_index_double(return_value, 2, load[2]);
  5096. }
  5097. }
  5098. /* }}} */
  5099. #endif
  5100. /*
  5101. * Local variables:
  5102. * tab-width: 4
  5103. * c-basic-offset: 4
  5104. * End:
  5105. * vim600: fdm=marker
  5106. * vim: noet sw=4 ts=4
  5107. */