[{"data":1,"prerenderedAt":1146},["ShallowReactive",2],{"content-\u002Fphp\u002Freferences":3,"related-\u002Fphp\u002Freferences":1016,"sidebar-content":1121},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"tags":10,"date":12,"weight":13,"body":14,"_type":1010,"_id":1011,"_source":1012,"_file":1013,"_stem":1014,"_extension":1015},"\u002Fphp\u002Freferences","php",false,"","PHP References (&)","Useful PHP reference snippets and patterns",[5,11],"backend","2026-03-19",2,{"type":15,"children":16,"toc":999},"root",[17,26,32,38,156,162,167,331,337,363,520,526,801,807,814,890,896,993],{"type":18,"tag":19,"props":20,"children":22},"element","h2",{"id":21},"what-are-references",[23],{"type":24,"value":25},"text","What Are References?",{"type":18,"tag":27,"props":28,"children":29},"p",{},[30],{"type":24,"value":31},"References in PHP are a way to access the same variable content by different names. They are not pointers like in C; they are symbol table aliases.",{"type":18,"tag":19,"props":33,"children":35},{"id":34},"assign-by-reference",[36],{"type":24,"value":37},"Assign by Reference",{"type":18,"tag":39,"props":40,"children":43},"pre",{"className":41,"code":42,"language":5,"meta":7,"style":7},"language-php shiki shiki-themes github-light github-dark","$a = 'hello';\n$b = &$a;  \u002F\u002F $b now points to the same value as $a\n\n$b = 'world';\necho $a;  \u002F\u002F Outputs: world\n",[44],{"type":18,"tag":45,"props":46,"children":47},"code",{"__ignoreMap":7},[48,77,105,115,136],{"type":18,"tag":49,"props":50,"children":53},"span",{"class":51,"line":52},"line",1,[54,60,66,72],{"type":18,"tag":49,"props":55,"children":57},{"style":56},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[58],{"type":24,"value":59},"$a ",{"type":18,"tag":49,"props":61,"children":63},{"style":62},"--shiki-default:#D73A49;--shiki-dark:#F97583",[64],{"type":24,"value":65},"=",{"type":18,"tag":49,"props":67,"children":69},{"style":68},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[70],{"type":24,"value":71}," 'hello'",{"type":18,"tag":49,"props":73,"children":74},{"style":56},[75],{"type":24,"value":76},";\n",{"type":18,"tag":49,"props":78,"children":79},{"class":51,"line":13},[80,85,89,94,99],{"type":18,"tag":49,"props":81,"children":82},{"style":56},[83],{"type":24,"value":84},"$b ",{"type":18,"tag":49,"props":86,"children":87},{"style":62},[88],{"type":24,"value":65},{"type":18,"tag":49,"props":90,"children":91},{"style":62},[92],{"type":24,"value":93}," &",{"type":18,"tag":49,"props":95,"children":96},{"style":56},[97],{"type":24,"value":98},"$a;  ",{"type":18,"tag":49,"props":100,"children":102},{"style":101},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[103],{"type":24,"value":104},"\u002F\u002F $b now points to the same value as $a\n",{"type":18,"tag":49,"props":106,"children":108},{"class":51,"line":107},3,[109],{"type":18,"tag":49,"props":110,"children":112},{"emptyLinePlaceholder":111},true,[113],{"type":24,"value":114},"\n",{"type":18,"tag":49,"props":116,"children":118},{"class":51,"line":117},4,[119,123,127,132],{"type":18,"tag":49,"props":120,"children":121},{"style":56},[122],{"type":24,"value":84},{"type":18,"tag":49,"props":124,"children":125},{"style":62},[126],{"type":24,"value":65},{"type":18,"tag":49,"props":128,"children":129},{"style":68},[130],{"type":24,"value":131}," 'world'",{"type":18,"tag":49,"props":133,"children":134},{"style":56},[135],{"type":24,"value":76},{"type":18,"tag":49,"props":137,"children":139},{"class":51,"line":138},5,[140,146,151],{"type":18,"tag":49,"props":141,"children":143},{"style":142},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[144],{"type":24,"value":145},"echo",{"type":18,"tag":49,"props":147,"children":148},{"style":56},[149],{"type":24,"value":150}," $a;  ",{"type":18,"tag":49,"props":152,"children":153},{"style":101},[154],{"type":24,"value":155},"\u002F\u002F Outputs: world\n",{"type":18,"tag":19,"props":157,"children":159},{"id":158},"pass-by-reference",[160],{"type":24,"value":161},"Pass by Reference",{"type":18,"tag":27,"props":163,"children":164},{},[165],{"type":24,"value":166},"Functions can modify the original variable by accepting a reference parameter:",{"type":18,"tag":39,"props":168,"children":170},{"className":41,"code":169,"language":5,"meta":7,"style":7},"function addSuffix(string &$text, string $suffix): void\n{\n    $text .= $suffix;\n}\n\n$name = 'Stash';\naddSuffix($name, 'Idea');\necho $name;  \u002F\u002F Outputs: StashIdea\n",[171],{"type":18,"tag":45,"props":172,"children":173},{"__ignoreMap":7},[174,226,234,252,260,267,289,313],{"type":18,"tag":49,"props":175,"children":176},{"class":51,"line":52},[177,182,188,193,198,202,207,211,216,221],{"type":18,"tag":49,"props":178,"children":179},{"style":62},[180],{"type":24,"value":181},"function",{"type":18,"tag":49,"props":183,"children":185},{"style":184},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[186],{"type":24,"value":187}," addSuffix",{"type":18,"tag":49,"props":189,"children":190},{"style":56},[191],{"type":24,"value":192},"(",{"type":18,"tag":49,"props":194,"children":195},{"style":62},[196],{"type":24,"value":197},"string",{"type":18,"tag":49,"props":199,"children":200},{"style":62},[201],{"type":24,"value":93},{"type":18,"tag":49,"props":203,"children":204},{"style":56},[205],{"type":24,"value":206},"$text, ",{"type":18,"tag":49,"props":208,"children":209},{"style":62},[210],{"type":24,"value":197},{"type":18,"tag":49,"props":212,"children":213},{"style":56},[214],{"type":24,"value":215}," $suffix)",{"type":18,"tag":49,"props":217,"children":218},{"style":62},[219],{"type":24,"value":220},":",{"type":18,"tag":49,"props":222,"children":223},{"style":62},[224],{"type":24,"value":225}," void\n",{"type":18,"tag":49,"props":227,"children":228},{"class":51,"line":13},[229],{"type":18,"tag":49,"props":230,"children":231},{"style":56},[232],{"type":24,"value":233},"{\n",{"type":18,"tag":49,"props":235,"children":236},{"class":51,"line":107},[237,242,247],{"type":18,"tag":49,"props":238,"children":239},{"style":56},[240],{"type":24,"value":241},"    $text ",{"type":18,"tag":49,"props":243,"children":244},{"style":62},[245],{"type":24,"value":246},".=",{"type":18,"tag":49,"props":248,"children":249},{"style":56},[250],{"type":24,"value":251}," $suffix;\n",{"type":18,"tag":49,"props":253,"children":254},{"class":51,"line":117},[255],{"type":18,"tag":49,"props":256,"children":257},{"style":56},[258],{"type":24,"value":259},"}\n",{"type":18,"tag":49,"props":261,"children":262},{"class":51,"line":138},[263],{"type":18,"tag":49,"props":264,"children":265},{"emptyLinePlaceholder":111},[266],{"type":24,"value":114},{"type":18,"tag":49,"props":268,"children":270},{"class":51,"line":269},6,[271,276,280,285],{"type":18,"tag":49,"props":272,"children":273},{"style":56},[274],{"type":24,"value":275},"$name ",{"type":18,"tag":49,"props":277,"children":278},{"style":62},[279],{"type":24,"value":65},{"type":18,"tag":49,"props":281,"children":282},{"style":68},[283],{"type":24,"value":284}," 'Stash'",{"type":18,"tag":49,"props":286,"children":287},{"style":56},[288],{"type":24,"value":76},{"type":18,"tag":49,"props":290,"children":292},{"class":51,"line":291},7,[293,298,303,308],{"type":18,"tag":49,"props":294,"children":295},{"style":184},[296],{"type":24,"value":297},"addSuffix",{"type":18,"tag":49,"props":299,"children":300},{"style":56},[301],{"type":24,"value":302},"($name, ",{"type":18,"tag":49,"props":304,"children":305},{"style":68},[306],{"type":24,"value":307},"'Idea'",{"type":18,"tag":49,"props":309,"children":310},{"style":56},[311],{"type":24,"value":312},");\n",{"type":18,"tag":49,"props":314,"children":316},{"class":51,"line":315},8,[317,321,326],{"type":18,"tag":49,"props":318,"children":319},{"style":142},[320],{"type":24,"value":145},{"type":18,"tag":49,"props":322,"children":323},{"style":56},[324],{"type":24,"value":325}," $name;  ",{"type":18,"tag":49,"props":327,"children":328},{"style":101},[329],{"type":24,"value":330},"\u002F\u002F Outputs: StashIdea\n",{"type":18,"tag":19,"props":332,"children":334},{"id":333},"references-in-loops",[335],{"type":24,"value":336},"References in Loops",{"type":18,"tag":338,"props":339,"children":341},"alert",{"type":340},"warning",[342],{"type":18,"tag":27,"props":343,"children":344},{},[345,347,353,355,361],{"type":24,"value":346},"Be careful with references in ",{"type":18,"tag":45,"props":348,"children":350},{"className":349},[],[351],{"type":24,"value":352},"foreach",{"type":24,"value":354}," loops — always ",{"type":18,"tag":45,"props":356,"children":358},{"className":357},[],[359],{"type":24,"value":360},"unset",{"type":24,"value":362}," after the loop.",{"type":18,"tag":39,"props":364,"children":366},{"className":41,"code":365,"language":5,"meta":7,"style":7},"$items = [1, 2, 3];\n\nforeach ($items as &$item) {\n    $item *= 2;\n}\nunset($item);  \u002F\u002F Important! Prevents bugs\n\nprint_r($items);  \u002F\u002F [2, 4, 6]\n",[367],{"type":18,"tag":45,"props":368,"children":369},{"__ignoreMap":7},[370,416,423,449,471,478,495,502],{"type":18,"tag":49,"props":371,"children":372},{"class":51,"line":52},[373,378,382,387,392,397,402,406,411],{"type":18,"tag":49,"props":374,"children":375},{"style":56},[376],{"type":24,"value":377},"$items ",{"type":18,"tag":49,"props":379,"children":380},{"style":62},[381],{"type":24,"value":65},{"type":18,"tag":49,"props":383,"children":384},{"style":56},[385],{"type":24,"value":386}," [",{"type":18,"tag":49,"props":388,"children":389},{"style":142},[390],{"type":24,"value":391},"1",{"type":18,"tag":49,"props":393,"children":394},{"style":56},[395],{"type":24,"value":396},", ",{"type":18,"tag":49,"props":398,"children":399},{"style":142},[400],{"type":24,"value":401},"2",{"type":18,"tag":49,"props":403,"children":404},{"style":56},[405],{"type":24,"value":396},{"type":18,"tag":49,"props":407,"children":408},{"style":142},[409],{"type":24,"value":410},"3",{"type":18,"tag":49,"props":412,"children":413},{"style":56},[414],{"type":24,"value":415},"];\n",{"type":18,"tag":49,"props":417,"children":418},{"class":51,"line":13},[419],{"type":18,"tag":49,"props":420,"children":421},{"emptyLinePlaceholder":111},[422],{"type":24,"value":114},{"type":18,"tag":49,"props":424,"children":425},{"class":51,"line":107},[426,430,435,440,444],{"type":18,"tag":49,"props":427,"children":428},{"style":62},[429],{"type":24,"value":352},{"type":18,"tag":49,"props":431,"children":432},{"style":56},[433],{"type":24,"value":434}," ($items ",{"type":18,"tag":49,"props":436,"children":437},{"style":62},[438],{"type":24,"value":439},"as",{"type":18,"tag":49,"props":441,"children":442},{"style":62},[443],{"type":24,"value":93},{"type":18,"tag":49,"props":445,"children":446},{"style":56},[447],{"type":24,"value":448},"$item) {\n",{"type":18,"tag":49,"props":450,"children":451},{"class":51,"line":117},[452,457,462,467],{"type":18,"tag":49,"props":453,"children":454},{"style":56},[455],{"type":24,"value":456},"    $item ",{"type":18,"tag":49,"props":458,"children":459},{"style":62},[460],{"type":24,"value":461},"*=",{"type":18,"tag":49,"props":463,"children":464},{"style":142},[465],{"type":24,"value":466}," 2",{"type":18,"tag":49,"props":468,"children":469},{"style":56},[470],{"type":24,"value":76},{"type":18,"tag":49,"props":472,"children":473},{"class":51,"line":138},[474],{"type":18,"tag":49,"props":475,"children":476},{"style":56},[477],{"type":24,"value":259},{"type":18,"tag":49,"props":479,"children":480},{"class":51,"line":269},[481,485,490],{"type":18,"tag":49,"props":482,"children":483},{"style":142},[484],{"type":24,"value":360},{"type":18,"tag":49,"props":486,"children":487},{"style":56},[488],{"type":24,"value":489},"($item);  ",{"type":18,"tag":49,"props":491,"children":492},{"style":101},[493],{"type":24,"value":494},"\u002F\u002F Important! Prevents bugs\n",{"type":18,"tag":49,"props":496,"children":497},{"class":51,"line":291},[498],{"type":18,"tag":49,"props":499,"children":500},{"emptyLinePlaceholder":111},[501],{"type":24,"value":114},{"type":18,"tag":49,"props":503,"children":504},{"class":51,"line":315},[505,510,515],{"type":18,"tag":49,"props":506,"children":507},{"style":142},[508],{"type":24,"value":509},"print_r",{"type":18,"tag":49,"props":511,"children":512},{"style":56},[513],{"type":24,"value":514},"($items);  ",{"type":18,"tag":49,"props":516,"children":517},{"style":101},[518],{"type":24,"value":519},"\u002F\u002F [2, 4, 6]\n",{"type":18,"tag":19,"props":521,"children":523},{"id":522},"returning-references",[524],{"type":24,"value":525},"Returning References",{"type":18,"tag":39,"props":527,"children":529},{"className":41,"code":528,"language":5,"meta":7,"style":7},"class Config\n{\n    private array $data = ['debug' => false];\n\n    public function &get(string $key): mixed\n    {\n        return $this->data[$key];\n    }\n}\n\n$config = new Config();\n$debug = &$config->get('debug');\n$debug = true;  \u002F\u002F Modifies the internal array\n",[530],{"type":18,"tag":45,"props":531,"children":532},{"__ignoreMap":7},[533,546,553,598,605,649,657,680,688,696,704,732,774],{"type":18,"tag":49,"props":534,"children":535},{"class":51,"line":52},[536,541],{"type":18,"tag":49,"props":537,"children":538},{"style":62},[539],{"type":24,"value":540},"class",{"type":18,"tag":49,"props":542,"children":543},{"style":184},[544],{"type":24,"value":545}," Config\n",{"type":18,"tag":49,"props":547,"children":548},{"class":51,"line":13},[549],{"type":18,"tag":49,"props":550,"children":551},{"style":56},[552],{"type":24,"value":233},{"type":18,"tag":49,"props":554,"children":555},{"class":51,"line":107},[556,561,566,571,575,579,584,589,594],{"type":18,"tag":49,"props":557,"children":558},{"style":62},[559],{"type":24,"value":560},"    private",{"type":18,"tag":49,"props":562,"children":563},{"style":62},[564],{"type":24,"value":565}," array",{"type":18,"tag":49,"props":567,"children":568},{"style":56},[569],{"type":24,"value":570}," $data ",{"type":18,"tag":49,"props":572,"children":573},{"style":62},[574],{"type":24,"value":65},{"type":18,"tag":49,"props":576,"children":577},{"style":56},[578],{"type":24,"value":386},{"type":18,"tag":49,"props":580,"children":581},{"style":68},[582],{"type":24,"value":583},"'debug'",{"type":18,"tag":49,"props":585,"children":586},{"style":62},[587],{"type":24,"value":588}," =>",{"type":18,"tag":49,"props":590,"children":591},{"style":142},[592],{"type":24,"value":593}," false",{"type":18,"tag":49,"props":595,"children":596},{"style":56},[597],{"type":24,"value":415},{"type":18,"tag":49,"props":599,"children":600},{"class":51,"line":117},[601],{"type":18,"tag":49,"props":602,"children":603},{"emptyLinePlaceholder":111},[604],{"type":24,"value":114},{"type":18,"tag":49,"props":606,"children":607},{"class":51,"line":138},[608,613,618,622,627,631,635,640,644],{"type":18,"tag":49,"props":609,"children":610},{"style":62},[611],{"type":24,"value":612},"    public",{"type":18,"tag":49,"props":614,"children":615},{"style":62},[616],{"type":24,"value":617}," function",{"type":18,"tag":49,"props":619,"children":620},{"style":62},[621],{"type":24,"value":93},{"type":18,"tag":49,"props":623,"children":624},{"style":184},[625],{"type":24,"value":626},"get",{"type":18,"tag":49,"props":628,"children":629},{"style":56},[630],{"type":24,"value":192},{"type":18,"tag":49,"props":632,"children":633},{"style":62},[634],{"type":24,"value":197},{"type":18,"tag":49,"props":636,"children":637},{"style":56},[638],{"type":24,"value":639}," $key)",{"type":18,"tag":49,"props":641,"children":642},{"style":62},[643],{"type":24,"value":220},{"type":18,"tag":49,"props":645,"children":646},{"style":62},[647],{"type":24,"value":648}," mixed\n",{"type":18,"tag":49,"props":650,"children":651},{"class":51,"line":269},[652],{"type":18,"tag":49,"props":653,"children":654},{"style":56},[655],{"type":24,"value":656},"    {\n",{"type":18,"tag":49,"props":658,"children":659},{"class":51,"line":291},[660,665,670,675],{"type":18,"tag":49,"props":661,"children":662},{"style":62},[663],{"type":24,"value":664},"        return",{"type":18,"tag":49,"props":666,"children":667},{"style":142},[668],{"type":24,"value":669}," $this",{"type":18,"tag":49,"props":671,"children":672},{"style":62},[673],{"type":24,"value":674},"->",{"type":18,"tag":49,"props":676,"children":677},{"style":56},[678],{"type":24,"value":679},"data[$key];\n",{"type":18,"tag":49,"props":681,"children":682},{"class":51,"line":315},[683],{"type":18,"tag":49,"props":684,"children":685},{"style":56},[686],{"type":24,"value":687},"    }\n",{"type":18,"tag":49,"props":689,"children":691},{"class":51,"line":690},9,[692],{"type":18,"tag":49,"props":693,"children":694},{"style":56},[695],{"type":24,"value":259},{"type":18,"tag":49,"props":697,"children":699},{"class":51,"line":698},10,[700],{"type":18,"tag":49,"props":701,"children":702},{"emptyLinePlaceholder":111},[703],{"type":24,"value":114},{"type":18,"tag":49,"props":705,"children":707},{"class":51,"line":706},11,[708,713,717,722,727],{"type":18,"tag":49,"props":709,"children":710},{"style":56},[711],{"type":24,"value":712},"$config ",{"type":18,"tag":49,"props":714,"children":715},{"style":62},[716],{"type":24,"value":65},{"type":18,"tag":49,"props":718,"children":719},{"style":62},[720],{"type":24,"value":721}," new",{"type":18,"tag":49,"props":723,"children":724},{"style":142},[725],{"type":24,"value":726}," Config",{"type":18,"tag":49,"props":728,"children":729},{"style":56},[730],{"type":24,"value":731},"();\n",{"type":18,"tag":49,"props":733,"children":735},{"class":51,"line":734},12,[736,741,745,749,754,758,762,766,770],{"type":18,"tag":49,"props":737,"children":738},{"style":56},[739],{"type":24,"value":740},"$debug ",{"type":18,"tag":49,"props":742,"children":743},{"style":62},[744],{"type":24,"value":65},{"type":18,"tag":49,"props":746,"children":747},{"style":62},[748],{"type":24,"value":93},{"type":18,"tag":49,"props":750,"children":751},{"style":56},[752],{"type":24,"value":753},"$config",{"type":18,"tag":49,"props":755,"children":756},{"style":62},[757],{"type":24,"value":674},{"type":18,"tag":49,"props":759,"children":760},{"style":184},[761],{"type":24,"value":626},{"type":18,"tag":49,"props":763,"children":764},{"style":56},[765],{"type":24,"value":192},{"type":18,"tag":49,"props":767,"children":768},{"style":68},[769],{"type":24,"value":583},{"type":18,"tag":49,"props":771,"children":772},{"style":56},[773],{"type":24,"value":312},{"type":18,"tag":49,"props":775,"children":777},{"class":51,"line":776},13,[778,782,786,791,796],{"type":18,"tag":49,"props":779,"children":780},{"style":56},[781],{"type":24,"value":740},{"type":18,"tag":49,"props":783,"children":784},{"style":62},[785],{"type":24,"value":65},{"type":18,"tag":49,"props":787,"children":788},{"style":142},[789],{"type":24,"value":790}," true",{"type":18,"tag":49,"props":792,"children":793},{"style":56},[794],{"type":24,"value":795},";  ",{"type":18,"tag":49,"props":797,"children":798},{"style":101},[799],{"type":24,"value":800},"\u002F\u002F Modifies the internal array\n",{"type":18,"tag":19,"props":802,"children":804},{"id":803},"common-pitfalls",[805],{"type":24,"value":806},"Common Pitfalls",{"type":18,"tag":808,"props":809,"children":811},"h3",{"id":810},"dangling-references",[812],{"type":24,"value":813},"Dangling References",{"type":18,"tag":39,"props":815,"children":817},{"className":41,"code":816,"language":5,"meta":7,"style":7},"$a = 'foo';\n$b = &$a;\nunset($a);\necho $b;  \u002F\u002F Still outputs: foo — only the alias is removed\n",[818],{"type":18,"tag":45,"props":819,"children":820},{"__ignoreMap":7},[821,841,861,873],{"type":18,"tag":49,"props":822,"children":823},{"class":51,"line":52},[824,828,832,837],{"type":18,"tag":49,"props":825,"children":826},{"style":56},[827],{"type":24,"value":59},{"type":18,"tag":49,"props":829,"children":830},{"style":62},[831],{"type":24,"value":65},{"type":18,"tag":49,"props":833,"children":834},{"style":68},[835],{"type":24,"value":836}," 'foo'",{"type":18,"tag":49,"props":838,"children":839},{"style":56},[840],{"type":24,"value":76},{"type":18,"tag":49,"props":842,"children":843},{"class":51,"line":13},[844,848,852,856],{"type":18,"tag":49,"props":845,"children":846},{"style":56},[847],{"type":24,"value":84},{"type":18,"tag":49,"props":849,"children":850},{"style":62},[851],{"type":24,"value":65},{"type":18,"tag":49,"props":853,"children":854},{"style":62},[855],{"type":24,"value":93},{"type":18,"tag":49,"props":857,"children":858},{"style":56},[859],{"type":24,"value":860},"$a;\n",{"type":18,"tag":49,"props":862,"children":863},{"class":51,"line":107},[864,868],{"type":18,"tag":49,"props":865,"children":866},{"style":142},[867],{"type":24,"value":360},{"type":18,"tag":49,"props":869,"children":870},{"style":56},[871],{"type":24,"value":872},"($a);\n",{"type":18,"tag":49,"props":874,"children":875},{"class":51,"line":117},[876,880,885],{"type":18,"tag":49,"props":877,"children":878},{"style":142},[879],{"type":24,"value":145},{"type":18,"tag":49,"props":881,"children":882},{"style":56},[883],{"type":24,"value":884}," $b;  ",{"type":18,"tag":49,"props":886,"children":887},{"style":101},[888],{"type":24,"value":889},"\u002F\u002F Still outputs: foo — only the alias is removed\n",{"type":18,"tag":808,"props":891,"children":893},{"id":892},"array-references",[894],{"type":24,"value":895},"Array References",{"type":18,"tag":39,"props":897,"children":899},{"className":41,"code":898,"language":5,"meta":7,"style":7},"$arr1 = [1, 2, 3];\n$arr2 = &$arr1;\n$arr2[] = 4;\n\u002F\u002F Both $arr1 and $arr2 are now [1, 2, 3, 4]\n",[900],{"type":18,"tag":45,"props":901,"children":902},{"__ignoreMap":7},[903,943,964,985],{"type":18,"tag":49,"props":904,"children":905},{"class":51,"line":52},[906,911,915,919,923,927,931,935,939],{"type":18,"tag":49,"props":907,"children":908},{"style":56},[909],{"type":24,"value":910},"$arr1 ",{"type":18,"tag":49,"props":912,"children":913},{"style":62},[914],{"type":24,"value":65},{"type":18,"tag":49,"props":916,"children":917},{"style":56},[918],{"type":24,"value":386},{"type":18,"tag":49,"props":920,"children":921},{"style":142},[922],{"type":24,"value":391},{"type":18,"tag":49,"props":924,"children":925},{"style":56},[926],{"type":24,"value":396},{"type":18,"tag":49,"props":928,"children":929},{"style":142},[930],{"type":24,"value":401},{"type":18,"tag":49,"props":932,"children":933},{"style":56},[934],{"type":24,"value":396},{"type":18,"tag":49,"props":936,"children":937},{"style":142},[938],{"type":24,"value":410},{"type":18,"tag":49,"props":940,"children":941},{"style":56},[942],{"type":24,"value":415},{"type":18,"tag":49,"props":944,"children":945},{"class":51,"line":13},[946,951,955,959],{"type":18,"tag":49,"props":947,"children":948},{"style":56},[949],{"type":24,"value":950},"$arr2 ",{"type":18,"tag":49,"props":952,"children":953},{"style":62},[954],{"type":24,"value":65},{"type":18,"tag":49,"props":956,"children":957},{"style":62},[958],{"type":24,"value":93},{"type":18,"tag":49,"props":960,"children":961},{"style":56},[962],{"type":24,"value":963},"$arr1;\n",{"type":18,"tag":49,"props":965,"children":966},{"class":51,"line":107},[967,972,976,981],{"type":18,"tag":49,"props":968,"children":969},{"style":56},[970],{"type":24,"value":971},"$arr2[] ",{"type":18,"tag":49,"props":973,"children":974},{"style":62},[975],{"type":24,"value":65},{"type":18,"tag":49,"props":977,"children":978},{"style":142},[979],{"type":24,"value":980}," 4",{"type":18,"tag":49,"props":982,"children":983},{"style":56},[984],{"type":24,"value":76},{"type":18,"tag":49,"props":986,"children":987},{"class":51,"line":117},[988],{"type":18,"tag":49,"props":989,"children":990},{"style":101},[991],{"type":24,"value":992},"\u002F\u002F Both $arr1 and $arr2 are now [1, 2, 3, 4]\n",{"type":18,"tag":994,"props":995,"children":996},"style",{},[997],{"type":24,"value":998},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":107,"depth":107,"links":1000},[1001,1002,1003,1004,1005,1006],{"id":21,"depth":13,"text":25},{"id":34,"depth":13,"text":37},{"id":158,"depth":13,"text":161},{"id":333,"depth":13,"text":336},{"id":522,"depth":13,"text":525},{"id":803,"depth":13,"text":806,"children":1007},[1008,1009],{"id":810,"depth":107,"text":813},{"id":892,"depth":107,"text":895},"markdown","content:php:references.md","content","php\u002Freferences.md","php\u002Freferences","md",[1017,1025,1030,1036,1041,1046,1051,1056,1061,1070,1076,1081,1086,1091,1096,1101,1109,1114],{"_path":1018,"title":1019,"description":1020,"tags":1021,"date":1024},"\u002Fcompetitive-programming\u002Farray-manipulation\u002Ffor-looping","For Looping in Python","Using for loops to manipulate arrays in Python.",[1022,11,1023],"python","arrays","2026-03-18",{"_path":1026,"title":1027,"description":1028,"tags":1029,"date":1024},"\u002Fcompetitive-programming\u002Farray-manipulation\u002Fwhile-looping","While Looping in Python","Using while loops to manipulate arrays in Python.",[1022,11,1023],{"_path":1031,"title":1032,"description":1033,"tags":1034,"date":1035},"\u002Fcompetitive-programming\u002Fassignments","Assignments","Assignments in Python for competitive programming.",[1022,11],"2026-04-10",{"_path":1037,"title":1038,"description":1039,"tags":1040,"date":1035},"\u002Fcompetitive-programming\u002Fdata-type","Data Types","Data types in Python for competitive programming.",[1022,11],{"_path":1042,"title":1043,"description":1044,"tags":1045,"date":1035},"\u002Fcompetitive-programming\u002Fhash-map","Hash Map","Hash map implementation in Python for competitive programming.",[1022,11],{"_path":1047,"title":1048,"description":1049,"tags":1050,"date":1035},"\u002Fcompetitive-programming\u002Finput-output","Input and Output","Handling input and output in Python for competitive programming.",[1022,11],{"_path":1052,"title":1053,"description":1054,"tags":1055,"date":1024},"\u002Fcompetitive-programming\u002Fmath-library\u002Fsum","Sum Elements","Using for loops to sum elements in Python.",[1022,11,1023],{"_path":1057,"title":1058,"description":1059,"tags":1060,"date":1024},"\u002Fcompetitive-programming\u002Fmath-library\u002Fsummary","Summary","Summary of the math library in Python.",[1022,11,1023],{"_path":1062,"title":1063,"description":1064,"tags":1065,"date":1069},"\u002Fdocker\u002Fcheat-sheets","Docker Cheat Sheets","Cheat sheets for frequently used Docker commands and concepts",[1066,1067,1068],"docker","devops","infrastructure","2026-05-01",{"_path":1071,"title":1072,"description":1073,"tags":1074,"date":1075},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-container","Docker Container","Introduction to Docker containers and their usage",[1066,1067,1068],"2026-03-12",{"_path":1077,"title":1078,"description":1079,"tags":1080,"date":1075},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-execution","Docker Execution","Introduction to Docker execution and their usage",[1066,1067,1068],{"_path":1082,"title":1083,"description":1084,"tags":1085,"date":1075},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-image","Docker Image","Introduction to Docker images and their usage",[1066,1067,1068],{"_path":1087,"title":1088,"description":1089,"tags":1090,"date":1075},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-logging","Docker Logging","Introduction to Docker logging and their usage",[1066,1067,1068],{"_path":1092,"title":1093,"description":1094,"tags":1095,"date":1075},"\u002Fdocker\u002Fdocker-prerequisites\u002Fdocker-installation","Docker Installation","Introduction to Docker installation and their usage",[1066,1067,1068],{"_path":1097,"title":1098,"description":1099,"tags":1100,"date":1075},"\u002Fdocker\u002Fresources","Docker Resources","Collection of Docker resources for learning and reference",[1066,1067,1068],{"_path":1102,"title":1103,"description":1104,"tags":1105,"date":1075},"\u002Fjavascript\u002Fpromises","Promise Patterns","Common JavaScript promise patterns and async\u002Fawait usage",[1106,1107,1108],"javascript","frontend","async",{"_path":1110,"title":1111,"description":1112,"tags":1113,"date":1024},"\u002Fphp\u002Farrays","PHP Array Functions","Essential PHP array functions and patterns",[5,11,1023],{"_path":1115,"title":1116,"description":1117,"tags":1118,"date":1120},"\u002Fphp\u002Fpatterns\u002Fsingleton","Singleton Pattern","Implementing the singleton pattern in PHP",[5,1119,11],"patterns","2026-03-13",[1122,1123,1124,1125,1126,1127,1128,1130,1131,1133,1134,1136,1138,1140,1141,1142,1143,1144,1145],{"_path":1018,"title":1019,"weight":698},{"_path":1026,"title":1027,"weight":698},{"_path":1031,"title":1032,"weight":107},{"_path":1037,"title":1038,"weight":13},{"_path":1042,"title":1043,"weight":698},{"_path":1047,"title":1048,"weight":52},{"_path":1052,"title":1053,"weight":1129},20,{"_path":1057,"title":1058,"weight":698},{"_path":1062,"title":1063,"weight":1132},100,{"_path":1071,"title":1072,"weight":1129},{"_path":1077,"title":1078,"weight":1135},22,{"_path":1082,"title":1083,"weight":1137},21,{"_path":1087,"title":1088,"weight":1139},23,{"_path":1092,"title":1093,"weight":698},{"_path":1097,"title":1098,"weight":52},{"_path":1102,"title":1103},{"_path":1110,"title":1111,"weight":52},{"_path":1115,"title":1116},{"_path":4,"title":8,"weight":13},1777665108281]